From 4e88b938562cdd4f16b3b9ad4166f798d03dcd35 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 18 Aug 2022 07:20:30 +0100 Subject: [PATCH] Improve regPing negative handling logic --- core/bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/bot.py b/core/bot.py index 48e0374..0a1c820 100644 --- a/core/bot.py +++ b/core/bot.py @@ -647,7 +647,7 @@ class IRCBot(IRCClient): debug(f"regPing() {self.net}: negativepass is False for {self.num}") return # End of negative output reached with no blacklisted message - if negativepass is True: + elif negativepass is True: if self._negativePass is None: # check if it's not failed yet self._negativePass = True debug(f"regPing() {self.net}: negpass:True positive registration check - {self.num}") @@ -660,10 +660,8 @@ class IRCBot(IRCClient): else: debug(f"regPing() {self.net}: negative registration check - {self.num}") return - - if sinst["check"]: + else: if sinst["negative"]: - self._negativePass = None self.msg(sinst["entity"], sinst["negativemsg"]) debug( ( @@ -674,6 +672,8 @@ class IRCBot(IRCClient): return else: self._negativePass = True + + if sinst["check"]: if sinst["ping"]: self.msg(sinst["entity"], sinst["pingmsg"]) debug(f"regPing() {self.net}: sent ping '{sinst['pingmsg']}' to {sinst['entity']} - {self.num}")