diff options
author | mathieui <mathieui@mathieui.net> | 2014-10-25 16:50:19 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2014-10-25 16:50:51 +0200 |
commit | d2ca062eaa190cd837c5073ca83e71d2834c7059 (patch) | |
tree | 01875559c4bf2d0837b72501e50edfc4672dae67 /src/tabs | |
parent | 0dc36d959868a4448873686e684cb86ecab2d425 (diff) | |
download | poezio-d2ca062eaa190cd837c5073ca83e71d2834c7059.tar.gz poezio-d2ca062eaa190cd837c5073ca83e71d2834c7059.tar.bz2 poezio-d2ca062eaa190cd837c5073ca83e71d2834c7059.tar.xz poezio-d2ca062eaa190cd837c5073ca83e71d2834c7059.zip |
Make the features disco in chat more user-friendly
Diffstat (limited to 'src/tabs')
-rw-r--r-- | src/tabs/basetabs.py | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py index fbf57dc2..40dcb8e6 100644 --- a/src/tabs/basetabs.py +++ b/src/tabs/basetabs.py @@ -817,32 +817,17 @@ class OneToOneTab(ChatTab): else: self.__initial_disco = True - empty = not any((correct, attention, receipts)) - - features = [] - if correct or empty: - features.append(_('message correction (/correct)')) - if attention or empty: - features.append(_('attention requests (/attention)')) - if (receipts or empty) \ - and config.get('request_message_receipts'): - features.append(_('message delivery receipts')) - if len(features) > 1: - tail = features.pop() - else: - tail = None - features_str = ', '.join(features) - if tail and empty: - features_str += _(', nor %s') % tail - elif tail: - features_str += _(' and %s') % tail - - if empty: - msg = _('\x19%s}This contact does not support %s.') - else: - msg = _('\x19%s}This contact supports %s.') + ok = get_theme().CHAR_OK + nope = get_theme().CHAR_ERROR + + correct = ok if correct else nope + attention = ok if attention else nope + receipts = ok if receipts else nope + + msg = _('\x19%s}Contact supports: correction [%s], ' + 'attention [%s], receipts [%s].') color = dump_tuple(get_theme().COLOR_INFORMATION_TEXT) - msg = msg % (color, features_str) + msg = msg % (color, correct, attention, receipts) self.add_message(msg, typ=0) self.core.refresh_window() |