Improve regPing debugging

Mark Veidemanis 2 years ago
parent 2942929478
commit ce32ab4722

@ -640,23 +640,30 @@ class IRCBot(IRCClient):
if reset:
self._negativePass = None
debug(
(f"regProc() {self.net} - {self.num}: _negativePass:{self._negativepass} " f"negativepass:{negativepass}")
)
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}")
debug(
(
f"registerTest() {self.net} - {self.num} not passed negative:checknegativemsg "
f"check, {sinst['checknegativemsg']} present in message"
)
)
return
# End of negative output reached with no blacklisted message
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}")
# 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
debug(
(
f"registerTest() {self.net} - {self.num} passed negative:checkendnegative "
f"check, {sinst['checkendnegative']} present in message"
)
)
else:
debug(f"regPing() {self.net}: negative registration check - {self.num}")
return

@ -190,23 +190,11 @@ def registerTest(c):
confirmRegistration(
c["net"], c["num"], negativepass=False
) # Not passed negative check, report back
debug(
(
f"registerTest() {net} - {num} not passed negative:checknegativemsg "
f"check, {sinst['checknegativemsg']} present in message"
)
)
return
if sinst["checkendnegative"] in c["msg"]:
confirmRegistration(
c["net"], c["num"], negativepass=True
) # Passed the negative check, report back
debug(
(
f"registerTest() {net} - {num} passed negative:checkendnegative "
f"check, {sinst['checkendnegative']} present in message"
)
)
return
if sinst["ping"]:
if sinst["checkmsg2"] in c["msg"] and c["nick"] == sinst["entity"]:

Loading…
Cancel
Save