Implement query notifications and recognise ZNC's messages

This commit is contained in:
2018-05-07 19:58:19 +01:00
parent 2e2e35cad7
commit 66e7785f6f
8 changed files with 74 additions and 19 deletions

View File

@@ -220,7 +220,7 @@ class IRCBot(IRCClient):
def signedOn(self):
self.connected = True
log("signed on: %s" % self.name)
if main.config["ConnectionNotifications"]:
if main.config["Notifications"]["Connection"]:
keyword.sendMaster("SIGNON: %s" % self.name)
if self.authtype == "ns":
self.msg(self.authentity, "IDENTIFY %s" % self.nspass)
@@ -316,7 +316,7 @@ class IRCBotFactory(ReconnectingClientFactory):
error = reason.getErrorMessage()
log("%s: connection lost: %s" % (self.name, error))
sendAll("%s: connection lost: %s" % (self.name, error))
if main.config["ConnectionNotifications"]:
if main.config["Notifications"]["Connection"]:
keyword.sendMaster("CONNLOST %s: %s" % (self.name, error))
self.retry(connector)
#ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
@@ -328,7 +328,7 @@ class IRCBotFactory(ReconnectingClientFactory):
error = reason.getErrorMessage()
log("%s: connection failed: %s" % (self.name, error))
sendAll("%s: connection failed: %s" % (self.name, error))
if main.config["ConnectionNotifications"]:
if main.config["Notifications"]["Connection"]:
keyword.sendMaster("CONNFAIL %s: %s" % (self.name, error))
self.retry(connector)
#ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)