Add connecting and disconnecting notifications

This commit is contained in:
Mark Veidemanis 2018-02-21 20:24:08 +00:00
parent 57e54cbced
commit f53cb060d0
2 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,7 @@
"UsePassword": true,
"ConnectOnCreate": false,
"HighlightNotifications": true,
"ConnectionNotifications": true,
"Dist": {
"Enabled": true,
"SendOutput": false,

View File

@ -193,6 +193,7 @@ class IRCBot(IRCClient):
def signedOn(self):
self.connected = True
log("signed on: %s" % self.name)
helper.sendMaster("SIGNON: %s" % self.name)
if self.authtype == "ns":
self.msg(self.authentity, "IDENTIFY %s" % self.nspass)
for i in self.autojoin:
@ -271,6 +272,7 @@ class IRCBotFactory(ReconnectingClientFactory):
error = reason.getErrorMessage()
log("%s: connection lost: %s" % (self.name, error))
helper.sendAll("%s: connection lost: %s" % (self.name, error))
helper.sendMaster("CONNLOST %s: %s" % (self.name, error))
self.retry(connector)
#ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
@ -281,6 +283,7 @@ class IRCBotFactory(ReconnectingClientFactory):
error = reason.getErrorMessage()
log("%s: connection failed: %s" % (self.name, error))
helper.sendAll("%s: connection failed: %s" % (self.name, error))
helper.sendMaster("CONNFAIL %s: %s" % (self.name, error))
self.retry(connector)
#ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)