Commit 2dafd6d5 authored by mathieui's avatar mathieui

Only display the supported features when they change

also, check the features every rejoin for PrivateTabs
and refresh the window after displaying the features
parent a1f86720
......@@ -714,6 +714,8 @@ class OneToOneTab(ChatTab):
def __init__(self, jid=''):
ChatTab.__init__(self, jid)
# Set to true once the first disco is done
self.__initial_disco = False
# 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
......@@ -803,10 +805,18 @@ class OneToOneTab(ChatTab):
"Features check callback"
features = iq['disco_info'].get_features() or []
log.debug('\n\nFEATURES:\n%s\n\n%s\n\n', iq, features)
before = ('correct' in self.commands,
correct = self._feature_correct(features)
attention = self._feature_attention(features)
receipts = self._feature_receipts(features)
if (correct, attention, receipts) == before and self.__initial_disco:
self.__initial_disco = True
features = []
if correct:
features.append(_('message correction (/correct)'))
......@@ -826,5 +836,6 @@ class OneToOneTab(ChatTab):
color = dump_tuple(get_theme().COLOR_INFORMATION_TEXT)
msg = msg % (color, features_str)
self.add_message(msg, typ=0)
......@@ -331,6 +331,7 @@ class PrivateTab(OneToOneTab):
The user (or at least someone with the same nick) came back in the MUC
tab = self.core.get_tab_by_name(safeJID(, MucTab)
color = 3
if tab and config.get_by_tabname('display_user_color_in_join_part', '', self.general_jid, True):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment