From f53cb060d088747f218395fbbc5231e79b4500ba Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 21 Feb 2018 20:24:08 +0000 Subject: [PATCH] Add connecting and disconnecting notifications --- conf/example/config.json | 1 + threshold | 3 +++ 2 files changed, 4 insertions(+) diff --git a/conf/example/config.json b/conf/example/config.json index d2f87ff..7a944c1 100644 --- a/conf/example/config.json +++ b/conf/example/config.json @@ -9,6 +9,7 @@ "UsePassword": true, "ConnectOnCreate": false, "HighlightNotifications": true, + "ConnectionNotifications": true, "Dist": { "Enabled": true, "SendOutput": false, diff --git a/threshold b/threshold index 59dfebd..cc7569f 100755 --- a/threshold +++ b/threshold @@ -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)