From db4b6cc6f99a4dbb77e1eab46691fbf152ecffc1 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 1 Aug 2022 21:38:46 +0100 Subject: [PATCH] Implement requesting channel list for network --- api/views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/views.py b/api/views.py index 34c1adf..b35463c 100644 --- a/api/views.py +++ b/api/views.py @@ -417,7 +417,7 @@ class API(object): provision.provisionRelay(num, net) main.saveConf("network") - return dumps({"success": True, f"message": "created relay {num} with alias {alias} on {net}"}) + return dumps({"success": True, "message": f"created relay {num} with alias {alias} on {net}"}) @app.route("/irc/list//", methods=["POST"]) @login_required @@ -426,8 +426,8 @@ class API(object): return dumps({"success": False, "reason": "no such net."}) if 1 not in main.network[net].relays.keys(): return dumps({"success": False, "reason": f"no first relay on {net}"}) - num, alias = main.network[net].add_relay(1) - provision.provisionRelay(num, net) - main.saveConf("network") - - return dumps({"success": True, f"message": "created relay {num} with alias {alias} on {net}"}) \ No newline at end of file + name = f"{net}1" + if name not in main.IRCPool.keys(): + return dumps({"success": False, "reason": f"first relay not active for {net}"}) + main.IRCPool[name].list() + return dumps({"success": True, "message": f"requested list with first instance of {net}"})