瀏覽代碼

bugfix on_kick

tBKwtWS 7 年之前
父節點
當前提交
7466125fa1
共有 1 個文件被更改,包括 8 次插入10 次删除
  1. 8 10
      events/on_kick.py

+ 8 - 10
events/on_kick.py

@@ -44,14 +44,12 @@ def process_event(self, connection, event):
     
     # Report.
     if not channel == self.homechannel: # Not kicked from homechannel.
-        if not userstatus.atleast_halfop(self, kicked, self.homechannel):
-            if reason:
-                connection.privmsg(self.homechannel, red + kicked + reset + " has been kicked from " + red + channel + reset + " by " + red + kicker + reset + ": " + green + reason)
-            else:
-                connection.privmsg(self.homechannel, red + kicked + reset + " has been kicked from " + red + channel + reset + " by " + red + kicker + reset + ".")
+        if reason:
+            connection.privmsg(self.homechannel, red + kicked + reset + " has been kicked from " + red + channel + reset + " by " + red + kicker + reset + ": " + green + reason)
+        else:
+            connection.privmsg(self.homechannel, red + kicked + reset + " has been kicked from " + red + channel + reset + " by " + red + kicker + reset + ".")
     
     # React.
-    
     behaviour = self.db.one("SELECT aggressiveness FROM channels WHERE name='" + channel + "' AND network='" + self.network + "'")
     if behaviour == "passive":    # Passive behaviour.
         if kicked == connection.get_nickname() and channel == self.homechannel: # Bot was kicked from it's home channel.
@@ -69,8 +67,8 @@ def process_event(self, connection, event):
         ChanServ.unban(connection, channel, kicked)
         ChanServ.akick_del(connection, channel, kicked)
         
-        # Rejoin if bot was kicked from it's home channel.
-        if kicked == connection.get_nickname() and channel == self.homechannel:
+        # Rejoin if bot was kicked.
+        if kicked == connection.get_nickname():
             connection.privmsg("ChanServ", "UNBAN " + channel)
             do_everything_to.join(self, connection, self.homechannel)
         
@@ -87,8 +85,8 @@ def process_event(self, connection, event):
         ChanServ.unban(connection, channel, kicked)
         ChanServ.akick_del(connection, channel, kicked)
         
-        # Rejoin if bot was kicked from it's home channel.
-        if kicked == connection.get_nickname() and channel == self.homechannel:
+        # Rejoin if bot was kicked.
+        if kicked == connection.get_nickname():
             connection.privmsg("ChanServ", "UNBAN " + channel)
             do_everything_to.join(self, connection, self.homechannel)