From 7e15b04f98a251c9a958e7230326bca794652ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 12 Nov 2018 15:30:28 +0100 Subject: [PATCH] config: Add the lag_min_show option. --- matrix/bar_items.py | 2 +- matrix/config.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/matrix/bar_items.py b/matrix/bar_items.py index 34569e5..8c09f78 100644 --- a/matrix/bar_items.py +++ b/matrix/bar_items.py @@ -74,7 +74,7 @@ def matrix_bar_item_lag(data, item, window, buffer, extra_info): # pylint: disable=unused-argument for server in SERVERS.values(): if buffer in server.buffers.values() or buffer == server.server_buffer: - if server.lag >= 500: + if server.lag >= G.CONFIG.network.lag_min_show: color = W.color("irc.color.item_lag_counting") if server.lag_done: color = W.color("irc.color.item_lag_finished") diff --git a/matrix/config.py b/matrix/config.py index a126311..0c3da6a 100644 --- a/matrix/config.py +++ b/matrix/config.py @@ -568,6 +568,15 @@ class MatrixConfig(WeechatConfig): "their receival. If on, messages are immediately printed but " "colored differently until receival is confirmed."), ), + Option( + "lag_min_show", + "integer", + "", + 1, + 604800, + "500", + ("minimum lag to show (in milliseconds)"), + ), ] color_options = [