summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-12-08 20:43:38 +0100
committermathieui <mathieui@mathieui.net>2014-12-08 20:43:38 +0100
commitd6ec1897763d34eff46a048676bd421ec11d8b62 (patch)
tree7c79b632d31f7eed47926f8ae7c35a4c008940a8
parentad20d6dbc207ef09eec8b757314a4f084ae04ce9 (diff)
downloadpoezio-d6ec1897763d34eff46a048676bd421ec11d8b62.tar.gz
poezio-d6ec1897763d34eff46a048676bd421ec11d8b62.tar.bz2
poezio-d6ec1897763d34eff46a048676bd421ec11d8b62.tar.xz
poezio-d6ec1897763d34eff46a048676bd421ec11d8b62.zip
Add a visual “feature check” for chat states too
-rw-r--r--src/tabs/basetabs.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py
index 9c74c239..81a14253 100644
--- a/src/tabs/basetabs.py
+++ b/src/tabs/basetabs.py
@@ -710,11 +710,33 @@ class OneToOneTab(ChatTab):
# change this to True or False when
# we know that the remote user wants chatstates, or not.
# None means we don’t know yet, and we send only "active" chatstates
- self.remote_wants_chatstates = None
+ self._remote_wants_chatstates = None
self.remote_supports_attention = True
self.remote_supports_receipts = True
self.check_features()
+ @property
+ def remote_wants_chatstates(self):
+ return self._remote_wants_chatstates
+
+ @remote_wants_chatstates.setter
+ def remote_wants_chatstates(self, value):
+ old_value = self._remote_wants_chatstates
+ self._remote_wants_chatstates = value
+ if (old_value is None and value != None) or \
+ (old_value != value and value != None):
+ ok = get_theme().CHAR_OK
+ nope = get_theme().CHAR_EMPTY
+ support = ok if value else nope
+ if value:
+ msg = _('\x19%s}Contact supports chat states [%s].')
+ else:
+ msg = _('\x19%s}Contact does not support chat states [%s].')
+ color = dump_tuple(get_theme().COLOR_INFORMATION_TEXT)
+ msg = msg % (color, support)
+ self.add_message(msg, typ=0)
+ self.core.refresh_window()
+
def ack_message(self, msg_id):
"""
Ack a message