mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-26 21:11:13 -05:00
Added new config entries, removeAllBans|Quiets|Invites|Exempts to prevent by default the mass removal with ub *
This commit is contained in:
parent
6628af1088
commit
270b2c143f
@ -88,6 +88,15 @@ conf.registerChannelValue(ChanTracker, 'modesToAskWhenOpped',
|
|||||||
conf.registerChannelValue(ChanTracker, 'autoExpire',
|
conf.registerChannelValue(ChanTracker, 'autoExpire',
|
||||||
registry.Integer(-1, """default expiration time for newly placed bans; -1 disables auto-expiration, otherwise it's in seconds"""))
|
registry.Integer(-1, """default expiration time for newly placed bans; -1 disables auto-expiration, otherwise it's in seconds"""))
|
||||||
|
|
||||||
|
conf.registerChannelValue(ChanTracker, 'removeAllBans',
|
||||||
|
registry.Boolean(False, """prevent accidental removal of all bans"""))
|
||||||
|
conf.registerChannelValue(ChanTracker, 'removeAllQuiets',
|
||||||
|
registry.Boolean(False, """prevent accidental removal of all quiets"""))
|
||||||
|
conf.registerChannelValue(ChanTracker, 'removeAllExempts',
|
||||||
|
registry.Boolean(False, """prevent accidental removal of all exempts"""))
|
||||||
|
conf.registerChannelValue(ChanTracker, 'removeAllInvites',
|
||||||
|
registry.Boolean(False, """prevent accidental removal of all invites"""))
|
||||||
|
|
||||||
# announces related to logChannel
|
# announces related to logChannel
|
||||||
|
|
||||||
conf.registerChannelValue(ChanTracker, 'logChannel',
|
conf.registerChannelValue(ChanTracker, 'logChannel',
|
||||||
|
28
plugin.py
28
plugin.py
@ -1709,6 +1709,13 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
"""[<channel>] <nick|hostmask|*> [<nick|hostmask|*>]
|
"""[<channel>] <nick|hostmask|*> [<nick|hostmask|*>]
|
||||||
|
|
||||||
sets -q on them, if * found, remove them all"""
|
sets -q on them, if * found, remove them all"""
|
||||||
|
isMass = False
|
||||||
|
for item in items:
|
||||||
|
if item == '*':
|
||||||
|
isMass = True
|
||||||
|
if isMass and not self.registryValue('removeAllQuiets',channel=channel):
|
||||||
|
irc.reply('removal of all quiets has been disabled for %s' % channel)
|
||||||
|
return
|
||||||
b = self._removes(irc,msg,args,channel,'q',items,False)
|
b = self._removes(irc,msg,args,channel,'q',items,False)
|
||||||
if not msg.nick == irc.nick and not b:
|
if not msg.nick == irc.nick and not b:
|
||||||
irc.reply('nicks not found or hostmasks invalids or targets are not +q')
|
irc.reply('nicks not found or hostmasks invalids or targets are not +q')
|
||||||
@ -1722,6 +1729,13 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
for (option, arg) in optlist:
|
for (option, arg) in optlist:
|
||||||
if option == 'perm':
|
if option == 'perm':
|
||||||
perm = True
|
perm = True
|
||||||
|
isMass = False
|
||||||
|
for item in items:
|
||||||
|
if item == '*':
|
||||||
|
isMass = True
|
||||||
|
if isMass and not self.registryValue('removeAllBans',channel=channel):
|
||||||
|
irc.reply('removal of all bans has been disabled for %s' % channel)
|
||||||
|
return
|
||||||
b = self._removes(irc,msg,args,channel,'b',items,perm)
|
b = self._removes(irc,msg,args,channel,'b',items,perm)
|
||||||
if not msg.nick == irc.nick and not b:
|
if not msg.nick == irc.nick and not b:
|
||||||
if perm:
|
if perm:
|
||||||
@ -1737,6 +1751,13 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
"""[<channel>] <nick|hostmask|*> [<nick|hostmask|*>]
|
"""[<channel>] <nick|hostmask|*> [<nick|hostmask|*>]
|
||||||
|
|
||||||
sets -I on them, if * found, remove them all"""
|
sets -I on them, if * found, remove them all"""
|
||||||
|
isMass = False
|
||||||
|
for item in items:
|
||||||
|
if item == '*':
|
||||||
|
isMass = True
|
||||||
|
if isMass and not self.registryValue('removeAllInvites',channel=channel):
|
||||||
|
irc.reply('removal of all invites has been disabled for %s' % channel)
|
||||||
|
return
|
||||||
b = self._removes(irc,msg,args,channel,'I',items,False)
|
b = self._removes(irc,msg,args,channel,'I',items,False)
|
||||||
if not msg.nick == irc.nick and not b:
|
if not msg.nick == irc.nick and not b:
|
||||||
irc.reply('nicks not found or hostmasks invalids or targets are not +I')
|
irc.reply('nicks not found or hostmasks invalids or targets are not +I')
|
||||||
@ -1746,6 +1767,13 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
"""[<channel>] <nick|hostmask|*> [<nick|hostmask|*>]
|
"""[<channel>] <nick|hostmask|*> [<nick|hostmask|*>]
|
||||||
|
|
||||||
sets -e on them, if * found, remove them all"""
|
sets -e on them, if * found, remove them all"""
|
||||||
|
isMass = False
|
||||||
|
for item in items:
|
||||||
|
if item == '*':
|
||||||
|
isMass = True
|
||||||
|
if isMass and not self.registryValue('removeAllExempts',channel=channel):
|
||||||
|
irc.reply('removal of all exempts has been disabled for %s' % channel)
|
||||||
|
return
|
||||||
b = self._removes(irc,msg,args,channel,'e',items,False)
|
b = self._removes(irc,msg,args,channel,'e',items,False)
|
||||||
if not msg.nick == irc.nick and not b:
|
if not msg.nick == irc.nick and not b:
|
||||||
irc.reply('nicks not found or hostmasks invalids or targets are not +e')
|
irc.reply('nicks not found or hostmasks invalids or targets are not +e')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user