mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-30 07:21:12 -05:00
added a config var to disable bot asking for op, note : protection modes will be applied if you op before force him to cycle the channel, expired quiet/ban/whatever will always be done if you op it
This commit is contained in:
parent
e0da7b7cce
commit
6b148879f7
@ -125,6 +125,9 @@ conf.registerChannelValue(ChanTracker, 'announceCtcp',
|
||||
|
||||
# others settings
|
||||
|
||||
conf.registerChannelValue(ChanTracker, 'doNothingAboutOwnOpStatus',
|
||||
registry.Boolean(False, """bot will never try to change his own op status"""))
|
||||
|
||||
conf.registerChannelValue(ChanTracker, 'keepOp',
|
||||
registry.Boolean(False, """bot stays opped"""))
|
||||
|
||||
|
19
plugin.py
19
plugin.py
@ -1124,7 +1124,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
||||
affect = wrap(affect, ['private','user','int'])
|
||||
|
||||
def mark(self,irc,msg,args,user,ids,message):
|
||||
"""<id> [,<id>]
|
||||
"""<id> [,<id>] <message>
|
||||
|
||||
add comment on a mode change"""
|
||||
i = self.getIrc(irc)
|
||||
@ -1649,16 +1649,18 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
||||
chan.deopPending = False
|
||||
if chan.syn and not irc.nick in irc.state.channels[channel].ops and not chan.opAsked and self.registryValue('keepOp',channel=channel):
|
||||
# chan.syn is necessary, otherwise, bot can't call owner if rights missed ( see doNotice )
|
||||
chan.opAsked = True
|
||||
irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick)))
|
||||
retickle = True
|
||||
if not self.registryValue('doNothingAboutOwnOpStatus',channel=channel):
|
||||
chan.opAsked = True
|
||||
irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick)))
|
||||
retickle = True
|
||||
if len(chan.queue) or len(chan.action):
|
||||
if not irc.nick in irc.state.channels[channel].ops and not chan.opAsked:
|
||||
# pending actions, but not opped
|
||||
if not chan.deopAsked:
|
||||
chan.opAsked = True
|
||||
irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick)))
|
||||
retickle = True
|
||||
if not self.registryValue('doNothingAboutOwnOpStatus',channel=channel):
|
||||
chan.opAsked = True
|
||||
irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick)))
|
||||
retickle = True
|
||||
elif irc.nick in irc.state.channels[channel].ops:
|
||||
if not chan.deopAsked:
|
||||
if len(chan.queue):
|
||||
@ -1740,7 +1742,8 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
||||
del chan.mark[key]
|
||||
if irc.nick in irc.state.channels[channel].ops and not self.registryValue('keepOp',channel=channel) and not chan.deopPending and not chan.deopAsked:
|
||||
# ask for deop, delay it a bit
|
||||
self.unOp(irc,channel)
|
||||
if not self.registryValue('doNothingAboutOwnOpStatus',channel=channel):
|
||||
self.unOp(irc,channel)
|
||||
# moslty logChannel, and maybe few sync msgs
|
||||
if len(i.lowQueue):
|
||||
retickle = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user