diff options
author | href <href@random.sh> | 2021-09-03 04:04:21 +0200 |
---|---|---|
committer | href <href@random.sh> | 2021-09-03 04:04:21 +0200 |
commit | 5399fc818cf821c75f9f19fd00bf7905ba7fe7e3 (patch) | |
tree | 00408724f9778cc7323b1459782a762626d39b6a /lib/lsg/telegram_room.ex | |
parent | assets.. (diff) |
various fixes, web client wip, pubsub events
Diffstat (limited to '')
-rw-r--r-- | lib/lsg/telegram_room.ex | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/lsg/telegram_room.ex b/lib/lsg/telegram_room.ex index 9504cd4..1eeec8f 100644 --- a/lib/lsg/telegram_room.ex +++ b/lib/lsg/telegram_room.ex @@ -12,7 +12,7 @@ defmodule LSG.TelegramRoom do case IRC.Connection.get_network(net, chan) do %IRC.Connection{} -> :global.register_name({__MODULE__, net, chan}, self()) - {:ok, _} = Registry.register(IRC.PubSub, "#{net}/#{chan}:message", plugin: __MODULE__) + {:ok, _} = Registry.register(IRC.PubSub, "#{net}/#{chan}:messages", plugin: __MODULE__) {:ok, _} = Registry.register(IRC.PubSub, "#{net}/#{chan}:triggers", plugin: __MODULE__) err -> Logger.warn("Did not found telegram match for #{id} \"#{chat["title"]}\"") @@ -44,6 +44,10 @@ defmodule LSG.TelegramRoom do {:ok, state} end + def handle_info({:irc, _, _, message}, state) do + handle_info({:irc, nil, message}, state) + end + def handle_info({:irc, _, %IRC.Message{sender: %{nick: nick}, text: text}}, state) do LSG.Telegram.send_message(state.id, "<#{nick}> #{text}") {:ok, state} |