3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-26 04:32:51 +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: else:
continue continue
if v['links']: # Join up and output all the linked channel names. if v['links']:
s += ' '.join([''.join(link) for link in sorted(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. else: # Unless it's empty; then, well... just say no relays yet.
s += '(no relays yet)' s += '(no relays yet)'