3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

relay: hide disconnected networks from LINKED output

Closes #258.
This commit is contained in:
James Lu 2016-07-03 12:40:23 -07:00
parent 08b2eb7c45
commit 81fca49738

View File

@ -1604,8 +1604,11 @@ def linked(irc, source, args):
else:
continue
if v['links']: # Join up and output all the linked channel names.
s += ' '.join([''.join(link) for link in sorted(v['links'])])
if v['links']:
# Sort, join up and output all the linked channel names. Silently drop
# entries for disconnected networks.
s += ' '.join([''.join(link) for link in sorted(v['links']) if link[0] in world.networkobjects
and world.networkobjects[link[0]].connected.is_set()])
else: # Unless it's empty; then, well... just say no relays yet.
s += '(no relays yet)'