bar_items: Make the encryption warning sign configurable.
This commit is contained in:
parent
e8fa66bbcb
commit
286b15aa86
2 changed files with 20 additions and 1 deletions
|
@ -105,7 +105,9 @@ def matrix_bar_item_buffer_modes(data, item, window, buffer, extra_info):
|
||||||
|
|
||||||
if (server.client
|
if (server.client
|
||||||
and server.client.room_contains_unverified(room.room_id)):
|
and server.client.room_contains_unverified(room.room_id)):
|
||||||
modes.append("⚠️ ")
|
modes.append(
|
||||||
|
G.CONFIG.look.encryption_warning_sign,
|
||||||
|
)
|
||||||
|
|
||||||
if not server.connected:
|
if not server.connected:
|
||||||
modes.append("❌")
|
modes.append("❌")
|
||||||
|
|
|
@ -178,6 +178,10 @@ def logbook_category(value):
|
||||||
return "all"
|
return "all"
|
||||||
|
|
||||||
|
|
||||||
|
def eval_cast(string):
|
||||||
|
return W.string_eval_expression(string, {}, {}, {})
|
||||||
|
|
||||||
|
|
||||||
class WeechatConfig(object):
|
class WeechatConfig(object):
|
||||||
def __init__(self, sections):
|
def __init__(self, sections):
|
||||||
self._ptr = W.config_new(
|
self._ptr = W.config_new(
|
||||||
|
@ -268,6 +272,8 @@ class ConfigSection(object):
|
||||||
return bool(W.config_boolean(self._option_ptrs[name]))
|
return bool(W.config_boolean(self._option_ptrs[name]))
|
||||||
|
|
||||||
def str_getter(self):
|
def str_getter(self):
|
||||||
|
if cast_func:
|
||||||
|
return cast_func(W.config_string(self._option_ptrs[name]))
|
||||||
return W.config_string(self._option_ptrs[name])
|
return W.config_string(self._option_ptrs[name])
|
||||||
|
|
||||||
def str_evaluate_getter(self):
|
def str_evaluate_getter(self):
|
||||||
|
@ -340,6 +346,17 @@ class MatrixConfig(WeechatConfig):
|
||||||
"Typing: ",
|
"Typing: ",
|
||||||
("Prefix for the typing notice bar item."),
|
("Prefix for the typing notice bar item."),
|
||||||
),
|
),
|
||||||
|
Option(
|
||||||
|
"encryption_warning_sign",
|
||||||
|
"string",
|
||||||
|
"",
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"⚠️ ",
|
||||||
|
("A sign that is used to signal trust issues in encrypted "
|
||||||
|
"rooms (note: content is evaluated, see /help eval)"),
|
||||||
|
eval_cast,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
network_options = [
|
network_options = [
|
||||||
|
|
Loading…
Add table
Reference in a new issue