added feature : ask op about mode changes, per channel setting

This commit is contained in:
Nicolas Coevoet 2013-10-19 00:20:20 +02:00
parent 4645b552fb
commit 7ea47f81dd
2 changed files with 5 additions and 0 deletions

View File

@ -77,6 +77,9 @@ conf.registerChannelValue(ChanTracker, 'kickMode',
conf.registerChannelValue(ChanTracker, 'kickMessage',
registry.String("You are banned from this channel", """bot kick reason"""))
conf.registerChannelValue(ChanTracker, 'askOpAboutMode',
registry.Boolean(False,"Ask the op who added a mode changes in pm about duration and comment"""))
# related to channle's protection

View File

@ -2084,6 +2084,8 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
m = mode[1:]
if m in self.registryValue('modesToAskWhenOpped') or m in self.registryValue('modesToAsk'):
item = chan.addItem(m,value,msg.prefix,now,self.getDb(irc.network))
if msg.nick != irc.nick and self.registryValue('askOpAboutMode',channel=channel) and ircdb.checkCapability(msg.prefix, '%s,op' % channel):
irc.queueMsg(ircmsgs.privmsg(msg.nick,'Could you edit or mark [#%s +%s %s in %s] ?' % (item.uid,m,value,channel)))
if overexpire > 0:
# overwrite expires
if msg.nick != irc.nick: