mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Merge pull request #407 from resistivecorpse/testing
adds an on off config option for logging of joins parts and quits in Cha...
This commit is contained in:
commit
45e6b7be7a
@ -48,6 +48,8 @@ conf.registerGlobalValue(ChannelLogger, 'flushImmediately',
|
|||||||
registry.Boolean(False, _("""Determines whether channel logfiles will be
|
registry.Boolean(False, _("""Determines whether channel logfiles will be
|
||||||
flushed anytime they're written to, rather than being buffered by the
|
flushed anytime they're written to, rather than being buffered by the
|
||||||
operating system.""")))
|
operating system.""")))
|
||||||
|
conf.registerChannelValue(ChannelLogger, 'showJoinParts',
|
||||||
|
registry.Boolean(True, _("""Determines wether joins and parts are logged""")))
|
||||||
conf.registerChannelValue(ChannelLogger, 'stripFormatting',
|
conf.registerChannelValue(ChannelLogger, 'stripFormatting',
|
||||||
registry.Boolean(True, _("""Determines whether formatting characters (such
|
registry.Boolean(True, _("""Determines whether formatting characters (such
|
||||||
as bolding, color, etc.) are removed when writing the logs to disk.""")))
|
as bolding, color, etc.) are removed when writing the logs to disk.""")))
|
||||||
|
@ -207,6 +207,7 @@ class ChannelLogger(callbacks.Plugin):
|
|||||||
'*** %s is now known as %s\n', oldNick, newNick)
|
'*** %s is now known as %s\n', oldNick, newNick)
|
||||||
def doJoin(self, irc, msg):
|
def doJoin(self, irc, msg):
|
||||||
for channel in msg.args[0].split(','):
|
for channel in msg.args[0].split(','):
|
||||||
|
if(self.registryValue('showJoinParts', channel)):
|
||||||
self.doLog(irc, channel,
|
self.doLog(irc, channel,
|
||||||
'*** %s <%s> has joined %s\n',
|
'*** %s <%s> has joined %s\n',
|
||||||
msg.nick, msg.prefix, channel)
|
msg.nick, msg.prefix, channel)
|
||||||
@ -231,6 +232,7 @@ class ChannelLogger(callbacks.Plugin):
|
|||||||
else:
|
else:
|
||||||
reason = ""
|
reason = ""
|
||||||
for channel in msg.args[0].split(','):
|
for channel in msg.args[0].split(','):
|
||||||
|
if(self.registryValue('showJoinParts', channel)):
|
||||||
self.doLog(irc, channel,
|
self.doLog(irc, channel,
|
||||||
'*** %s <%s> has left %s%s\n',
|
'*** %s <%s> has left %s%s\n',
|
||||||
msg.nick, msg.prefix, channel, reason)
|
msg.nick, msg.prefix, channel, reason)
|
||||||
@ -258,6 +260,7 @@ class ChannelLogger(callbacks.Plugin):
|
|||||||
if not isinstance(irc, irclib.Irc):
|
if not isinstance(irc, irclib.Irc):
|
||||||
irc = irc.getRealIrc()
|
irc = irc.getRealIrc()
|
||||||
for (channel, chan) in self.lastStates[irc].channels.iteritems():
|
for (channel, chan) in self.lastStates[irc].channels.iteritems():
|
||||||
|
if(self.registryValue('showJoinParts', channel)):
|
||||||
if msg.nick in chan.users:
|
if msg.nick in chan.users:
|
||||||
self.doLog(irc, channel,
|
self.doLog(irc, channel,
|
||||||
'*** %s <%s> has quit IRC%s\n',
|
'*** %s <%s> has quit IRC%s\n',
|
||||||
|
Loading…
Reference in New Issue
Block a user