|
|
@@ -1,6 +1,6 @@
|
|
|
from common.networkservices import ChanServ
|
|
|
from common import userstatus, do_everything_to
|
|
|
-from events.common import Aggressiveness
|
|
|
+from events.common import Aggressiveness, Lastact
|
|
|
|
|
|
bold = "\x02"
|
|
|
italic = "\x1D"
|
|
|
@@ -18,6 +18,14 @@ def process_event(self, connection, event):
|
|
|
kicked = event.arguments[0]
|
|
|
reason = event.arguments[1]
|
|
|
|
|
|
+ # Update last act.
|
|
|
+ if reason:
|
|
|
+ Lastact.update(self, kicker, self.network, "kick", channel=channel, lastact=kicked, auxiliary=reason)
|
|
|
+ Lastact.update(self, kicked, self.network, "kicked", channel=channel, lastact=kicked, auxiliary=reason)
|
|
|
+ else:
|
|
|
+ Lastact.update(self, kicker, self.network, "kick", channel=channel, lastact=kicked)
|
|
|
+ Lastact.update(self, kicked, self.network, "kicked", channel=channel, lastact=kicked)
|
|
|
+
|
|
|
# Create user records if they don't exist.
|
|
|
if not self.db.one("SELECT id FROM users WHERE name='" + kicker + "' AND network='" + self.network + "'"): # Kicker does not have a user record.
|
|
|
self.db.run("INSERT INTO \"users\" (name, network) VALUES ('" + kicker + "', '" + self.network + "')") # Create user record.
|
|
|
@@ -66,7 +74,6 @@ def process_event(self, connection, event):
|
|
|
connection.privmsg("ChanServ", "UNBAN " + channel)
|
|
|
do_everything_to.join(self, connection, channel)
|
|
|
elif behaviour == "equal_retalliation": # Equal retalitory behaviour.
|
|
|
- ChanServ.unban(connection, channel, kicked)
|
|
|
ChanServ.akick_del(connection, channel, kicked)
|
|
|
|
|
|
# Rejoin if bot was kicked.
|
|
|
@@ -74,7 +81,6 @@ def process_event(self, connection, event):
|
|
|
connection.privmsg("ChanServ", "UNBAN " + channel)
|
|
|
do_everything_to.join(self, connection, self.homechannel)
|
|
|
|
|
|
-
|
|
|
if event.source.nick == connection.get_nickname() or self.channels[self.homechannel].is_owner(kicker):
|
|
|
return # Stop if offender is bot or owner.
|
|
|
if not userstatus.atleast_halfop(self, kicked, self.homechannel) or not kicked == connection.get_nickname():
|
|
|
@@ -87,15 +93,13 @@ def process_event(self, connection, event):
|
|
|
|
|
|
# Battlebot behaviour.
|
|
|
elif behaviour == "battlebot":
|
|
|
- ChanServ.unban(connection, channel, kicked)
|
|
|
ChanServ.akick_del(connection, channel, kicked)
|
|
|
|
|
|
# Rejoin if bot was kicked.
|
|
|
if kicked == connection.get_nickname():
|
|
|
- connection.privmsg("ChanServ", "UNBAN " + channel)
|
|
|
+ print("Rejoining " + channel)
|
|
|
do_everything_to.join(self, connection, self.homechannel)
|
|
|
|
|
|
-
|
|
|
if event.source.nick == connection.get_nickname() or self.channels[self.homechannel].is_owner(kicker):
|
|
|
print("Stop if offender is bot or owner")
|
|
|
return # Stop if offender is bot or owner.
|
|
|
@@ -107,13 +111,7 @@ def process_event(self, connection, event):
|
|
|
return # Stop if offender is at least halfop in the home channel and the offended is not owner.
|
|
|
print("Kickbanning")
|
|
|
|
|
|
- # Ban.
|
|
|
- ChanServ.tempban(connection, channel, kicker, "1h", "Aggression channel function = equal_retalliation: " + kicked + " is an operator of " + connection.get_nickname() + ".")
|
|
|
- connection.mode(channel, "+b " + event.source)
|
|
|
-
|
|
|
- connection.mode(channel, "+e " + event.source) # Excempt operator.
|
|
|
+ ChanServ.tempban(connection, channel, kicker, "1h", "Aggression channel function = equal_retalliation: " + kicked)
|
|
|
+ connection.mode(channel, "+e " + kicked) # Excempt operator.
|
|
|
ChanServ.akick_add(connection, channel, kicker) # Add kicker to ChanServs autokick.
|
|
|
-
|
|
|
- # Kick.
|
|
|
- ChanServ.kick(connection, channel, kicker, "Aggression channel function = equal_retalliation: " + kicked + " is an operator of " + connection.get_nickname() + ".")
|
|
|
- connection.kick(channel, kicker, "Aggression channel function = equal_retalliation: " + kicked + " is an operator of " + connection.get_nickname() + ".")
|
|
|
+ do_everything_to.bankick(connection, channel, kicker, "Aggression channel function = equal_retalliation: " + kicked)
|