From 53ee69540ff0e7777bd9df5274ca535c5e971285 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 18 Aug 2022 07:20:30 +0100 Subject: [PATCH] Fix double messages and regPing logic --- core/bot.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/bot.py b/core/bot.py index 4d33c5c..48e0374 100644 --- a/core/bot.py +++ b/core/bot.py @@ -640,20 +640,23 @@ class IRCBot(IRCClient): if reset: self._negativePass = None - if self._negativePass is not True: + if self._negativePass is None: + # We have failed, the blacklisted message has been found if negativepass is False: self._negativePass = False 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: - if self._negativePass is None: + 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}") - if sinst["ping"]: - debug("Sending ping - %s - %i" % (self.net, self.num)) - self.msg(sinst["entity"], sinst["pingmsg"]) - debug(f"regPing() {self.net}: sent ping '{sinst['pingmsg']}' to {sinst['entity']} - {self.num}") - return + # if sinst["ping"]: + # debug("Sending ping - %s - %i" % (self.net, self.num)) + # self.msg(sinst["entity"], sinst["pingmsg"]) + # debug(f"regPing() {self.net}: sent ping '{sinst['pingmsg']}' + # to {sinst['entity']} - {self.num}") + # return else: debug(f"regPing() {self.net}: negative registration check - {self.num}") return