summaryrefslogtreecommitdiff
path: root/lib/lsg_irc
diff options
context:
space:
mode:
authorhref <href@random.sh>2021-09-02 13:00:55 +0200
committerhref <href@random.sh>2021-09-02 13:00:55 +0200
commit28ab854e9dbcd2e40fc4b7986f4e5dd303bf27a1 (patch)
tree62bda7f25e7d9282283fc8eca290f60d7d0d8c86 /lib/lsg_irc
parentlastfm: improvements, fixes (diff)
improve puppets, fix uploads
Diffstat (limited to 'lib/lsg_irc')
-rw-r--r--lib/lsg_irc/say_plugin.ex3
-rw-r--r--lib/lsg_irc/user_mention_plugin.ex3
2 files changed, 4 insertions, 2 deletions
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")