mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
BadWords: bugfix & don't kick ops (Closes ProgVal/Limnoria#275)
This commit is contained in:
parent
015d7f38d0
commit
7e7c4425cf
@ -29,7 +29,6 @@
|
|||||||
###
|
###
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import math
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
@ -77,11 +76,18 @@ class BadWords(callbacks.Privmsg):
|
|||||||
self.updateRegexp(channel)
|
self.updateRegexp(channel)
|
||||||
s = ircutils.stripFormatting(msg.args[1])
|
s = ircutils.stripFormatting(msg.args[1])
|
||||||
if ircutils.isChannel(channel) and self.registryValue('kick', channel):
|
if ircutils.isChannel(channel) and self.registryValue('kick', channel):
|
||||||
if self.regexp.search(s):
|
if self.words and self.regexp.search(s):
|
||||||
if irc.nick in irc.state.channels[channel].ops or \
|
c = irc.state.channels[channel]
|
||||||
irc.nick in irc.state.channels[channel].halfops:
|
cap = ircdb.makeChannelCapability(channel, 'op')
|
||||||
message = self.registryValue('kick.message', channel)
|
if c.isHalfopPlus(irc.nick):
|
||||||
irc.queueMsg(ircmsgs.kick(channel, msg.nick, message))
|
if c.isHalfopPlus(msg.nick) or \
|
||||||
|
ircdb.checkCapability(msg.prefix, cap):
|
||||||
|
self.log.debug("Not kicking %s from %s, because "
|
||||||
|
"they are immune.", msg.nick,
|
||||||
|
channel)
|
||||||
|
else:
|
||||||
|
message = self.registryValue('kick.message', channel)
|
||||||
|
irc.queueMsg(ircmsgs.kick(channel, msg.nick, message))
|
||||||
else:
|
else:
|
||||||
self.log.warning('Should kick %s from %s, but not opped.',
|
self.log.warning('Should kick %s from %s, but not opped.',
|
||||||
msg.nick, channel)
|
msg.nick, channel)
|
||||||
|
Loading…
Reference in New Issue
Block a user