From df6b9e34a3f1b2ffeef94be0c602f5b70554b2b6 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 13 Aug 2022 13:47:42 +0100 Subject: [PATCH] Return relay numbers with channel list --- api/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/views.py b/api/views.py index 57c1238..a19a4a1 100644 --- a/api/views.py +++ b/api/views.py @@ -391,14 +391,16 @@ class API(object): if net not in main.network.keys(): return dumps({"success": False, "reason": "no such net."}) relays_inst = main.network[net].relays - channels = {} + channels = [] for num in relays_inst.keys(): name = f"{net}{num}" if name in main.IRCPool.keys(): net_chans = main.IRCPool[name].channels channels_annotated = userinfo.getUserNum(net, net_chans) for channel in net_chans: - channels[channel] = channels_annotated[channel] + channel_inst = {"name": channel, "users": channels_annotated[channel], "num": num} + channels.append(channel_inst) + # channels[channel] = channels_annotated[channel] return dumps({"channels": channels})