From 8979bc8c3d05bc897aa6ef063d0e0b7589d299cc Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 5 Apr 2004 10:15:05 +0000 Subject: [PATCH] takeRevengeOnOps. --- ChangeLog | 6 ++++++ plugins/Enforcer.py | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed7420c84..d62f14014 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ + * Added supybot.plugins.Enforcer.takeRevengeOnOps, which makes + the bot even take revenge on #channel,ops who try to violate the + channel configuration. Of course, such people can change the + channel configuration to their bidding, but it's a decent + protection against errant botscripts or something. + * Added supybot.plugins.Channels.alwaysRejoin, to make the bot always rejoin when it's kicked. diff --git a/plugins/Enforcer.py b/plugins/Enforcer.py index 9a4c37802..43992c36c 100644 --- a/plugins/Enforcer.py +++ b/plugins/Enforcer.py @@ -82,6 +82,10 @@ conf.registerChannelValue(conf.supybot.plugins.Enforcer, 'takeRevenge', registry.Boolean(False, """Determines whether the bot will take revenge on people who do things it doesn't like (somewhat like 'bitch mode' in other IRC bots).""")) +conf.registerChannelValue(conf.supybot.plugins.Enforcer, 'takeRevengeOnOps', + registry.Boolean(False, """Determines whether the bot will even take + revenge on ops (people with the #channel,op capability) who violate the + channel configuration.""")) conf.registerChannelValue(conf.supybot.plugins.Enforcer, 'cycleToGetOps', registry.Boolean(True, """Determines whether the bot will cycle the channel if it doesn't have ops and there's no one else in the channel.""")) @@ -165,7 +169,8 @@ class Enforcer(callbacks.Privmsg): channel = msg.args[0] kicked = msg.args[1].split(',') deop = False - if not self._isPowerful(irc, msg): + if not self._isPowerful(irc, msg) or \ + self.registryValue('takeRevengeOnOps', channel): for nick in kicked: hostmask = irc.state.nickToHostmask(nick) if nick == irc.nick: @@ -185,7 +190,9 @@ class Enforcer(callbacks.Privmsg): def doMode(self, irc, msg): channel = msg.args[0] chanserv = self.registryValue('ChanServ', channel) - if not ircutils.isChannel(channel) or self._isPowerful(irc, msg): + if not ircutils.isChannel(channel) or \ + (self._isPowerful(irc, msg) and \ + not self.registryValue('takeRevengeOnOps', channel): return for (mode, value) in ircutils.separateModes(msg.args[1:]): if value == msg.nick: