From fa5dca12de2e451c99d1689c8ff1cf260871f240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 15 May 2019 21:50:48 +0200 Subject: [PATCH] commands: Print out device display names. --- matrix/commands.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/matrix/commands.py b/matrix/commands.py index 463b079..bcdc204 100644 --- a/matrix/commands.py +++ b/matrix/commands.py @@ -486,13 +486,15 @@ def hook_commands(): hook_page_up() -def format_device(device_id, fp_key): +def format_device(device_id, fp_key, display_name): fp_key = partition_key(fp_key) - message = (" - Device ID: {device_color}{device_id}{ncolor}\n" - " - Device key: {key_color}{fp_key}{ncolor}").format( + message = (" - Device ID: {device_color}{device_id}{ncolor}\n" + " - Display name: {device_color}{display_name}{ncolor}\n" + " - Device key: {key_color}{fp_key}{ncolor}").format( device_color=W.color("chat_channel"), device_id=device_id, ncolor=W.color("reset"), + display_name=display_name, key_color=W.color("chat_server"), fp_key=fp_key) return message @@ -526,7 +528,8 @@ def olm_info_command(server, args): device_strings.append(format_device( device.id, - device.ed25519 + device.ed25519, + device.display_name )) if not device_strings: @@ -647,7 +650,8 @@ def olm_action_command(server, args, category, error_category, prefix, action): for device in device_list: device_strings.append(format_device( device.id, - device.ed25519 + device.ed25519, + device.display_name )) if not device_strings: continue