Skip to content

Commit

Permalink
ChannelLogger: Rewrite relayed nicks. Closes GH-507.
Browse files Browse the repository at this point in the history
  • Loading branch information
progval committed Aug 19, 2013
1 parent 1724d68 commit d14f5df
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/ChannelLogger/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,14 @@ def doPrivmsg(self, irc, msg):
ignoreOwner=True)
except KeyError:
logChannelMessages = True
nick = msg.nick or irc.nick
if msg.tagged('ChannelLogger__relayed'):
(nick, text) = text.split(' ', 1)
nick = nick[1:-1]
msg.args = (recipients, text)
if (noLogPrefix and text.startswith(noLogPrefix)) or \
not logChannelMessages:
text = '-= THIS MESSAGE NOT LOGGED =-'
nick = msg.nick or irc.nick
if ircmsgs.isAction(msg):
self.doLog(irc, channel,
'* %s %s\n', nick, ircmsgs.unAction(msg))
Expand Down Expand Up @@ -280,6 +284,8 @@ def outFilter(self, irc, msg):
if msg.command in ('PRIVMSG', 'NOTICE'):
# Other messages should be sent back to us.
m = ircmsgs.IrcMsg(msg=msg, prefix=irc.prefix)
if msg.tagged('relayedMsg'):
m.tag('ChannelLogger__relayed')
self(irc, m)
return msg

Expand Down

0 comments on commit d14f5df

Please sign in to comment.