From 4d543f31ec988794c7df2c7601acb57664d88165 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 13 Aug 2022 13:40:33 +0100 Subject: [PATCH] Add connected status to IRC info return and check when getting active relays --- api/views.py | 2 ++ modules/chankeep.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/views.py b/api/views.py index 9bb2e97..57c1238 100644 --- a/api/views.py +++ b/api/views.py @@ -310,9 +310,11 @@ class API(object): if name in main.IRCPool.keys(): to_append["chans"] = len(main.IRCPool[name].channels) to_append["nick"] = main.IRCPool[name].nickname + to_append["conn"] = main.IRCPool[name].isconnected else: to_append["chans"] = 0 to_append["nick"] = None + to_append["conn"] = False relays.append(to_append) return dumps({"relays": relays}) diff --git a/modules/chankeep.py b/modules/chankeep.py index 7279e97..1a497e0 100644 --- a/modules/chankeep.py +++ b/modules/chankeep.py @@ -33,7 +33,7 @@ def allRelaysActive(net): for i in activeRelays: name = net + str(i) if name in main.IRCPool.keys(): - if main.IRCPool[name].authenticated: + if main.IRCPool[name].authenticated and main.IRCPool[name].isconnected: existNum += 1 debug(f"allRelaysActive() finished, {existNum}/{relayNum} relays active for {net}") if existNum == relayNum: