From e4377c6d1afb2a6ac9d6b71e8db8f6c30adb5e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 15 Nov 2018 10:35:00 +0100 Subject: [PATCH] bar_items: Make the disconnect sign configurable. --- matrix/bar_items.py | 14 ++++---------- matrix/config.py | 11 +++++++++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/matrix/bar_items.py b/matrix/bar_items.py index 7260891..87d94c6 100644 --- a/matrix/bar_items.py +++ b/matrix/bar_items.py @@ -101,23 +101,17 @@ def matrix_bar_item_buffer_modes(data, item, window, buffer, extra_info): modes = [] if room.encrypted: - modes.append( - G.CONFIG.look.encrypted_room_sign - ) + modes.append(G.CONFIG.look.encrypted_room_sign) if (server.client and server.client.room_contains_unverified(room.room_id)): - modes.append( - G.CONFIG.look.encryption_warning_sign, - ) + modes.append(G.CONFIG.look.encryption_warning_sign) if not server.connected: - modes.append("❌") + modes.append(G.CONFIG.look.disconnect_sign) if room_buffer.backlog_pending or server.busy: - modes.append( - G.CONFIG.look.busy_sign - ) + modes.append(G.CONFIG.look.busy_sign) return "".join(modes) diff --git a/matrix/config.py b/matrix/config.py index 1dd2c4b..d842a9c 100644 --- a/matrix/config.py +++ b/matrix/config.py @@ -476,6 +476,17 @@ class MatrixConfig(WeechatConfig): "(note: content is evaluated, see /help eval)"), eval_cast, ), + Option( + "disconnect_sign", + "string", + "", + 0, + 0, + "❌", + ("A sign that is used to show that the server is disconnected " + "(note: content is evaluated, see /help eval)"), + eval_cast, + ), Option( "pygments_style", "string",