diff --git a/api/views.py b/api/views.py index adbac22..59d12d0 100644 --- a/api/views.py +++ b/api/views.py @@ -194,25 +194,6 @@ class API(object): } return dumps(networks) - @app.route("/irc/network//", methods=["POST"]) - @login_required - def irc_network(self, request, net): - if net not in main.network.keys(): - return dumps({"success": False, "reason": "no such net."}) - inst = main.network[net] - network = {} - network["net"] = inst.net - network["auth"] = inst.auth - network["host"] = inst.host - network["last"] = inst.last - network["port"] = inst.port - network["security"] = inst.security - network["relays"] = len(inst.relays) - network["chanlimit"] = inst.chanlimit - network["channels"] = userinfo.getTotalChanNum(net) - network["records"] = userinfo.getNumWhoEntries(net) - return dumps(network) - @app.route("/irc/network/auth/", methods=["POST"]) @login_required def irc_network_recheckauth(self, request): @@ -249,6 +230,25 @@ class API(object): regproc.registerAccount(conn.net, conn.num) return dumps({"success": True}) + @app.route("/irc/network//", methods=["POST"]) + @login_required + def irc_network(self, request, net): + if net not in main.network.keys(): + return dumps({"success": False, "reason": "no such net."}) + inst = main.network[net] + network = {} + network["net"] = inst.net + network["auth"] = inst.auth + network["host"] = inst.host + network["last"] = inst.last + network["port"] = inst.port + network["security"] = inst.security + network["relays"] = len(inst.relays) + network["chanlimit"] = inst.chanlimit + network["channels"] = userinfo.getTotalChanNum(net) + network["records"] = userinfo.getNumWhoEntries(net) + return dumps(network) + @app.route("/irc/network//", methods=["DELETE"]) @login_required def irc_network_delete(self, request, net):