diff options
author | href <href@random.sh> | 2021-09-02 09:56:32 +0200 |
---|---|---|
committer | href <href@random.sh> | 2021-09-02 09:56:32 +0200 |
commit | 9b6d97fb820d2efc6892b0ada3340df10df35f4b (patch) | |
tree | 6d7200c07e610a2ae56128cf716e4ffda18d9d9e /lib/lsg_irc/say_plugin.ex | |
parent | web: show help for only enabled plugins (diff) |
puppet connections
Diffstat (limited to '')
-rw-r--r-- | lib/lsg_irc/say_plugin.ex | 10 |
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 |