Properly handle networks when looking up users' online status
This commit is contained in:
parent
0457cfbbed
commit
654c9960ba
|
@ -44,18 +44,21 @@ def annotate_results(results_parsed):
|
|||
|
||||
for net in nets:
|
||||
# Annotate the online attribute from Threshold
|
||||
online_info = annotate_online(
|
||||
net, [x["nick"] for x in results_parsed if x["src"] == "irc"]
|
||||
)
|
||||
nicks = [
|
||||
x["nick"] for x in results_parsed if x["src"] == "irc" and x["net"] == net
|
||||
]
|
||||
channels = [
|
||||
x["channel"]
|
||||
for x in results_parsed
|
||||
if x["src"] == "irc" and x["net"] == net
|
||||
]
|
||||
online_info = annotate_online(net, nicks)
|
||||
# Annotate the number of users in the channel
|
||||
num_users = annotate_num_users(
|
||||
net, [x["channel"] for x in results_parsed if x["src"] == "irc"]
|
||||
)
|
||||
num_users = annotate_num_users(net, channels)
|
||||
# Annotate the number channels the user is on
|
||||
num_chans = annotate_num_chans(
|
||||
net, [x["nick"] for x in results_parsed if x["src"] == "irc"]
|
||||
)
|
||||
num_chans = annotate_num_chans(net, nicks)
|
||||
for item in results_parsed:
|
||||
if item["net"] == net:
|
||||
if "nick" in item:
|
||||
if item["nick"] in online_info:
|
||||
item["online"] = online_info[item["nick"]]
|
||||
|
|
Loading…
Reference in New Issue