diff options
Diffstat (limited to 'lib/lsg_irc/say_plugin.ex')
-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 |