Implement requesting channel list for network

This commit is contained in:
Mark Veidemanis 2022-08-01 21:38:46 +01:00
parent dae62ea544
commit db4b6cc6f9
1 changed files with 6 additions and 6 deletions

View File

@ -417,7 +417,7 @@ class API(object):
provision.provisionRelay(num, net) provision.provisionRelay(num, net)
main.saveConf("network") 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/<net>/", methods=["POST"]) @app.route("/irc/list/<net>/", methods=["POST"])
@login_required @login_required
@ -426,8 +426,8 @@ class API(object):
return dumps({"success": False, "reason": "no such net."}) return dumps({"success": False, "reason": "no such net."})
if 1 not in main.network[net].relays.keys(): if 1 not in main.network[net].relays.keys():
return dumps({"success": False, "reason": f"no first relay on {net}"}) return dumps({"success": False, "reason": f"no first relay on {net}"})
num, alias = main.network[net].add_relay(1) name = f"{net}1"
provision.provisionRelay(num, net) if name not in main.IRCPool.keys():
main.saveConf("network") return dumps({"success": False, "reason": f"first relay not active for {net}"})
main.IRCPool[name].list()
return dumps({"success": True, f"message": "created relay {num} with alias {alias} on {net}"}) return dumps({"success": True, "message": f"requested list with first instance of {net}"})