From 9b6d97fb820d2efc6892b0ada3340df10df35f4b Mon Sep 17 00:00:00 2001 From: href Date: Thu, 2 Sep 2021 09:56:32 +0200 Subject: puppet connections --- lib/lsg/telegram_room.ex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/lsg/telegram_room.ex') diff --git a/lib/lsg/telegram_room.ex b/lib/lsg/telegram_room.ex index 8c228e1..f973c58 100644 --- a/lib/lsg/telegram_room.ex +++ b/lib/lsg/telegram_room.ex @@ -22,10 +22,8 @@ defmodule LSG.TelegramRoom do def handle_update(%{"message" => %{"from" => %{"id" => user_id}, "text" => text}}, _token, state) do account = IRC.Account.find_meta_account("telegram-id", user_id) - user = IRC.UserTrack.find_by_account(state.net, account) - nick = if(user, do: user.nick, else: account.name) - prefix = "<#{nick}> " - IRC.Connection.broadcast_message(state.net, state.chan, "#{prefix}#{text}") + connection = IRC.Connection.get_network(state.net) + IRC.PuppetConnection.send_message(account, connection, state.chan, text) {:ok, state} end -- cgit v1.2.3