mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
ChannelLogger: include in logs the reasons for parts and quits
This commit is contained in:
parent
da25be73d4
commit
6ccd1ce3d6
@ -226,10 +226,14 @@ class ChannelLogger(callbacks.Plugin):
|
||||
'*** %s was kicked by %s\n', target, msg.nick)
|
||||
|
||||
def doPart(self, irc, msg):
|
||||
if len(msg.args) > 1:
|
||||
reason = " (%s)" % msg.args[1]
|
||||
else:
|
||||
reason = ""
|
||||
for channel in msg.args[0].split(','):
|
||||
self.doLog(irc, channel,
|
||||
'*** %s <%s> has left %s\n',
|
||||
msg.nick, msg.prefix, channel)
|
||||
'*** %s <%s> has left %s%s\n',
|
||||
msg.nick, msg.prefix, channel, reason)
|
||||
|
||||
def doMode(self, irc, msg):
|
||||
channel = msg.args[0]
|
||||
@ -247,13 +251,17 @@ class ChannelLogger(callbacks.Plugin):
|
||||
'*** %s changes topic to "%s"\n', msg.nick, msg.args[1])
|
||||
|
||||
def doQuit(self, irc, msg):
|
||||
if len(msg.args) == 1:
|
||||
reason = " (%s)" % msg.args[0]
|
||||
else:
|
||||
reason = ""
|
||||
if not isinstance(irc, irclib.Irc):
|
||||
irc = irc.getRealIrc()
|
||||
for (channel, chan) in self.lastStates[irc].channels.iteritems():
|
||||
if msg.nick in chan.users:
|
||||
self.doLog(irc, channel,
|
||||
'*** %s <%s> has quit IRC\n',
|
||||
msg.nick, msg.prefix)
|
||||
'*** %s <%s> has quit IRC%s\n',
|
||||
msg.nick, msg.prefix, reason)
|
||||
|
||||
def outFilter(self, irc, msg):
|
||||
# Gotta catch my own messages *somehow* :)
|
||||
|
Loading…
Reference in New Issue
Block a user