浏览代码

on_mode loop fix

tBKwtWS 7 年之前
父节点
当前提交
d9b0d8d4dd
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      events/on_mode.py

+ 5 - 4
events/on_mode.py

@@ -52,11 +52,12 @@ def process_event(self, connection, event):
         if event.source.nick == connection.get_nickname() or self.channels[self.homechannel].is_owner(event.source.nick):
             return
         
-        # Stop if offender is atleast halfop in the home channel and offended is not owner.
-        if userstatus.atleast_halfop(self, event.source.nick, self.homechannel) and not self.channels[self.homechannel].is_owner(protectee):
-            return
-        
         for protectee in self.protectees:
+            
+            # Stop if offender is atleast halfop in the home channel and offended is not owner.
+            if userstatus.atleast_halfop(self, event.source.nick, self.homechannel) and not self.channels[self.homechannel].is_owner(protectee):
+                return
+            
             if behaviour == "passive":    # Passive behaviour.
                 return
             elif behaviour == "defense_only":   # Defensive only behaviour.