Commit 554c79b1 authored by Svetlana Tkachenko's avatar Svetlana Tkachenko
Browse files

Add kick_myself option to blockbot plugin. Default is 1 for backwards compatibility.

parent 4a8e43e8
......@@ -28,6 +28,7 @@ class Blockbot(object):
def __init__(self, server):
self.server = server
self.commands = []
self.nick = self.server.config["nickname"]
server.handle("message", self.handle_message)
findlist = [
......@@ -37,6 +38,7 @@ class Blockbot(object):
self.storage_time = 25
self.repeat_limit = 3
self.repeat_1word = 4
self.kick_myself = 1 # Set this to 0 if you don't want guppy to kick itself for flood
# Compile Spam Strings
self.findlist = []
......@@ -72,7 +74,10 @@ class Blockbot(object):
# Check for flooding
if self.get_mps(user_msgs) > self.mps_limit:
self.server.doKick(channel, nick, 'flood')
if ((nick == self.nick) and (self.kick_myself == 0)):
1
else:
self.server.doKick(channel, nick, 'flood')
self.msglist.pop(0)
# Check for repeats
......@@ -84,7 +89,10 @@ class Blockbot(object):
else:
repeats += 1
if repeats > self.repeat_limit - 1:
self.server.doKick(channel, nick, 'flood/repetition')
if ((nick == self.nick) and (self.kick_myself == 0)):
1
else:
self.server.doKick(channel, nick, 'flood/repetition')
self.msglist.pop(0)
# Clear out old messages
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment