Add debug statements and only check if network is connected when parting channels

This commit is contained in:
2022-08-14 09:25:54 +01:00
parent 9b14979f29
commit feecf48b9b
2 changed files with 25 additions and 5 deletions

View File

@@ -620,22 +620,24 @@ class IRCBot(IRCClient):
return
sinst = regproc.substitute(self.net, self.num)
if not sinst:
error(f"Registration ping failed for {self.net} - {self.num}")
error(f"regPing() {self.net}: registration ping failed for {self.num}")
return
if self._negativePass is not True:
if negativepass is False:
self._negativePass = False
debug(f"regPing() {self.net}: negativepass is False for {self.num}")
return
if negativepass is True:
if self._negativePass is None:
self._negativePass = True
debug("Positive registration check - %s - %i" % (self.net, self.num))
debug(f"regPing() {self.net}: 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
else:
debug("Negative registration for %s - %i" % (self.net, self.num))
debug("regPing() {self.net}: negative registration check - {self.num}")
return
if sinst["check"]: