summaryrefslogtreecommitdiff
path: root/lib/lsg_irc/say_plugin.ex
diff options
context:
space:
mode:
authorhref <href@random.sh>2021-09-02 09:56:32 +0200
committerhref <href@random.sh>2021-09-02 09:56:32 +0200
commit9b6d97fb820d2efc6892b0ada3340df10df35f4b (patch)
tree6d7200c07e610a2ae56128cf716e4ffda18d9d9e /lib/lsg_irc/say_plugin.ex
parentweb: show help for only enabled plugins (diff)
puppet connections
Diffstat (limited to '')
-rw-r--r--lib/lsg_irc/say_plugin.ex10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/lsg_irc/say_plugin.ex b/lib/lsg_irc/say_plugin.ex
index 690d0a6..c385e77 100644
--- a/lib/lsg_irc/say_plugin.ex
+++ b/lib/lsg_irc/say_plugin.ex
@@ -61,10 +61,12 @@ defmodule LSG.IRC.SayPlugin do
for {net, chan} <- IRC.Membership.of_account(account) do
chan2 = String.replace(chan, "#", "")
if (target == "#{net}/#{chan}" || target == "#{net}/#{chan2}" || target == chan || target == chan2) do
- user = IRC.UserTrack.find_by_account(net, account)
- nick = if(user, do: user.nick, else: account.name)
- prefix = if(with_nick?, do: "<#{nick}> ", else: "")
- IRC.Connection.broadcast_message(net, chan, "#{prefix}#{text}")
+ if with_nick? do
+ connection = IRC.Connection.get_network(net)
+ IRC.PuppetConnection.send_message(account, connection, chan, text)
+ else
+ IRC.Connection.broadcast_message(net, chan, text)
+ end
end
end
end