From 28ab854e9dbcd2e40fc4b7986f4e5dd303bf27a1 Mon Sep 17 00:00:00 2001 From: href Date: Thu, 2 Sep 2021 13:00:55 +0200 Subject: improve puppets, fix uploads --- lib/lsg_irc/say_plugin.ex | 3 +-- lib/lsg_irc/user_mention_plugin.ex | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/lsg_irc') diff --git a/lib/lsg_irc/say_plugin.ex b/lib/lsg_irc/say_plugin.ex index c385e77..085ca92 100644 --- a/lib/lsg_irc/say_plugin.ex +++ b/lib/lsg_irc/say_plugin.ex @@ -62,8 +62,7 @@ defmodule LSG.IRC.SayPlugin do chan2 = String.replace(chan, "#", "") if (target == "#{net}/#{chan}" || target == "#{net}/#{chan2}" || target == chan || target == chan2) do if with_nick? do - connection = IRC.Connection.get_network(net) - IRC.PuppetConnection.send_message(account, connection, chan, text) + IRC.send_message_as(account, net, chan, text) else IRC.Connection.broadcast_message(net, chan, text) end diff --git a/lib/lsg_irc/user_mention_plugin.ex b/lib/lsg_irc/user_mention_plugin.ex index 5f7b10a..ca743c4 100644 --- a/lib/lsg_irc/user_mention_plugin.ex +++ b/lib/lsg_irc/user_mention_plugin.ex @@ -20,6 +20,9 @@ defmodule LSG.IRC.UserMentionPlugin do end def handle_info({:irc, :trigger, nick, message = %IRC.Message{sender: sender, account: account, network: network, channel: channel, trigger: %IRC.Trigger{type: :at, args: content}}}, state) do + nick = nick + |> String.trim(":") + |> String.trim(",") target = IRC.Account.find_always_by_nick(network, channel, nick) if target do telegram = IRC.Account.get_meta(target, "telegram-id") -- cgit v1.2.3