added new setting that allows to not announce modes made by ignored user

This commit is contained in:
Nicolas Coevoet 2014-07-18 18:45:14 +02:00
parent 872550c353
commit 95f8d1cb75
2 changed files with 6 additions and 2 deletions

View File

@ -83,6 +83,9 @@ conf.registerChannelValue(ChanTracker, 'announceOthers',
registry.Boolean(True,"""forward messages from quieted/banned users to logChannel; used when bot stays opped and channel is +z (reduced moderation). registry.Boolean(True,"""forward messages from quieted/banned users to logChannel; used when bot stays opped and channel is +z (reduced moderation).
Messages from users flagged as bad, or when channel is under attack will not be forwarded""")) Messages from users flagged as bad, or when channel is under attack will not be forwarded"""))
conf.registerChannelValue(ChanTracker, 'announceModeMadeByIgnored',
registry.Boolean(True,"""announce channel modes made by ignored user"""))
conf.registerChannelValue(ChanTracker, 'announceWithNotice', conf.registerChannelValue(ChanTracker, 'announceWithNotice',
registry.Boolean(False,"""use NOTICE instead of PRIVMSG to logChannel""")) registry.Boolean(False,"""use NOTICE instead of PRIVMSG to logChannel"""))

View File

@ -2784,8 +2784,9 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
if irc.nick in irc.state.channels[channel].ops and not self.registryValue('keepOp',channel=channel): if irc.nick in irc.state.channels[channel].ops and not self.registryValue('keepOp',channel=channel):
self.forceTickle = True self.forceTickle = True
if len(self.registryValue('announceModes',channel=channel)) and len(msgs): if len(self.registryValue('announceModes',channel=channel)) and len(msgs):
self._logChan(irc,channel,'[%s] %s sets %s' % (channel,msg.nick,' '.join(msgs))) if self.registryValue('announceModeMadeByIgnored',channel=channel) or not ircdb.checkIgnored(msg.prefix,channel):
self.forceTickle = True self._logChan(irc,channel,'[%s] %s sets %s' % (channel,msg.nick,' '.join(msgs)))
self.forceTickle = True
if len(toexpire): if len(toexpire):
for item in toexpire: for item in toexpire:
f = None f = None