diff --git a/ethermess.py b/ethermess.py index cf0fcff..cb57cda 100644 --- a/ethermess.py +++ b/ethermess.py @@ -178,11 +178,17 @@ def handle_user_command(backend, line): elif command == '/status': # Request status - mac = mac_from_name(rest) - if mac in peers: - print('=== ~%s (%s) [%s]' % (peers[mac].nick, peers[mac].status.name, format_mac(mac))) + if rest != '': + mac = mac_from_name(rest) + if mac in peers: + print('=== ~%s (%s) [%s]' % (peers[mac].nick, peers[mac].status.name, format_mac(mac))) + else: + send_status_request(backend, mac) + else: - send_status_request(backend, mac) + # List all the known peers + for mac, peer in peers.items(): + print('=== ~%s (%s) [%s]' % (peer.nick, peer.status.name, format_mac(mac))) elif command == '/available' and rest == '': # Set status to available @@ -210,7 +216,7 @@ def handle_user_command(backend, line): else: # Display usage - print('--- / ; /msg ; /status ; /available; /unavailable; /nick ; /target ; /quit') + print('--- / ; /msg ; /status []; /available; /unavailable; /nick ; /target ; /quit') except NoMatchesError as err: print('--- name %s matches no peers' % err.args[0])