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
|
# others settings
|
||||||
|
|
||||||
|
conf.registerChannelValue(ChanTracker, 'doNothingAboutOwnOpStatus',
|
||||||
|
registry.Boolean(False, """bot will never try to change his own op status"""))
|
||||||
|
|
||||||
conf.registerChannelValue(ChanTracker, 'keepOp',
|
conf.registerChannelValue(ChanTracker, 'keepOp',
|
||||||
registry.Boolean(False, """bot stays opped"""))
|
registry.Boolean(False, """bot stays opped"""))
|
||||||
|
|
||||||
|
@ -1124,7 +1124,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
affect = wrap(affect, ['private','user','int'])
|
affect = wrap(affect, ['private','user','int'])
|
||||||
|
|
||||||
def mark(self,irc,msg,args,user,ids,message):
|
def mark(self,irc,msg,args,user,ids,message):
|
||||||
"""<id> [,<id>]
|
"""<id> [,<id>] <message>
|
||||||
|
|
||||||
add comment on a mode change"""
|
add comment on a mode change"""
|
||||||
i = self.getIrc(irc)
|
i = self.getIrc(irc)
|
||||||
@ -1649,6 +1649,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
chan.deopPending = False
|
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):
|
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.syn is necessary, otherwise, bot can't call owner if rights missed ( see doNotice )
|
||||||
|
if not self.registryValue('doNothingAboutOwnOpStatus',channel=channel):
|
||||||
chan.opAsked = True
|
chan.opAsked = True
|
||||||
irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick)))
|
irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick)))
|
||||||
retickle = True
|
retickle = True
|
||||||
@ -1656,6 +1657,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
if not irc.nick in irc.state.channels[channel].ops and not chan.opAsked:
|
if not irc.nick in irc.state.channels[channel].ops and not chan.opAsked:
|
||||||
# pending actions, but not opped
|
# pending actions, but not opped
|
||||||
if not chan.deopAsked:
|
if not chan.deopAsked:
|
||||||
|
if not self.registryValue('doNothingAboutOwnOpStatus',channel=channel):
|
||||||
chan.opAsked = True
|
chan.opAsked = True
|
||||||
irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick)))
|
irc.queueMsg(ircmsgs.IrcMsg(self.registryValue('opCommand',channel=channel).replace('$channel',channel).replace('$nick',irc.nick)))
|
||||||
retickle = True
|
retickle = True
|
||||||
@ -1740,6 +1742,7 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
del chan.mark[key]
|
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:
|
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
|
# ask for deop, delay it a bit
|
||||||
|
if not self.registryValue('doNothingAboutOwnOpStatus',channel=channel):
|
||||||
self.unOp(irc,channel)
|
self.unOp(irc,channel)
|
||||||
# moslty logChannel, and maybe few sync msgs
|
# moslty logChannel, and maybe few sync msgs
|
||||||
if len(i.lowQueue):
|
if len(i.lowQueue):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user