summaryrefslogtreecommitdiff
path: root/src/tabs
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-05-17 15:51:42 +0200
committermathieui <mathieui@mathieui.net>2014-05-17 15:51:42 +0200
commit2dafd6d5cfc612dc50b54d3b1c06e4450df6424e (patch)
tree9ca1947e4b3254e3c9899e6041284cd47e4c0985 /src/tabs
parenta1f86720d1f5104a4ef8a2cb38ad26504790fee9 (diff)
downloadpoezio-2dafd6d5cfc612dc50b54d3b1c06e4450df6424e.tar.gz
poezio-2dafd6d5cfc612dc50b54d3b1c06e4450df6424e.tar.bz2
poezio-2dafd6d5cfc612dc50b54d3b1c06e4450df6424e.tar.xz
poezio-2dafd6d5cfc612dc50b54d3b1c06e4450df6424e.zip
Only display the supported features when they change
also, check the features every rejoin for PrivateTabs and refresh the window after displaying the features
Diffstat (limited to 'src/tabs')
-rw-r--r--src/tabs/basetabs.py11
-rw-r--r--src/tabs/privatetab.py1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py
index 8aa3d0b6..44066955 100644
--- a/src/tabs/basetabs.py
+++ b/src/tabs/basetabs.py
@@ -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,
+ self.remote_supports_attention,
+ self.remote_supports_receipts)
correct = self._feature_correct(features)
attention = self._feature_attention(features)
receipts = self._feature_receipts(features)
+ if (correct, attention, receipts) == before and self.__initial_disco:
+ return
+ else:
+ 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)
+ self.core.refresh_window()
diff --git a/src/tabs/privatetab.py b/src/tabs/privatetab.py
index 6ab06744..b68225cf 100644
--- a/src/tabs/privatetab.py
+++ b/src/tabs/privatetab.py
@@ -331,6 +331,7 @@ class PrivateTab(OneToOneTab):
The user (or at least someone with the same nick) came back in the MUC
"""
self.activate()
+ self.check_features()
tab = self.core.get_tab_by_name(safeJID(self.name).bare, MucTab)
color = 3
if tab and config.get_by_tabname('display_user_color_in_join_part', '', self.general_jid, True):