From 5b513f763e1bf565d56cfca38f0e4e8ac42effb5 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 30 Sep 2015 20:00:48 +0200 Subject: [PATCH] request archiving preferences only if server announce it supports it, and don't think it supports it while it's buggy. Fixes #7839 --- src/common/connection.py | 18 +++++++++--------- src/common/message_archiving.py | 8 ++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 28bb98844..ff14a8257 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -1919,7 +1919,6 @@ class Connection(CommonConnection, ConnectionHandlers): # If we are not resuming, we ask for discovery info # and archiving preferences if not self.sm.supports_sm or (not self.sm.resuming and self.sm.enabled): - self.request_message_archiving_preferences() self.discoverInfo(gajim.config.get_per('accounts', self.name, 'hostname'), id_prefix='Gajim_') @@ -2026,14 +2025,15 @@ class Connection(CommonConnection, ConnectionHandlers): if nbxmpp.NS_ARCHIVE in obj.features: self.archiving_supported = True self.archiving_136_supported = True - if nbxmpp.NS_ARCHIVE_AUTO in obj.features: - self.archive_auto_supported = True - if nbxmpp.NS_ARCHIVE_MANAGE in obj.features: - self.archive_manage_supported = True - if nbxmpp.NS_ARCHIVE_MANUAL in obj.features: - self.archive_manual_supported = True - if nbxmpp.NS_ARCHIVE_PREF in obj.features: - self.archive_pref_supported = True + self.request_message_archiving_preferences() + if nbxmpp.NS_ARCHIVE_AUTO in obj.features: + self.archive_auto_supported = True + if nbxmpp.NS_ARCHIVE_MANAGE in obj.features: + self.archive_manage_supported = True + if nbxmpp.NS_ARCHIVE_MANUAL in obj.features: + self.archive_manual_supported = True + if nbxmpp.NS_ARCHIVE_PREF in obj.features: + self.archive_pref_supported = True if nbxmpp.NS_BLOCKING in obj.features: self.blocking_supported = True if nbxmpp.NS_ADDRESS in obj.features: diff --git a/src/common/message_archiving.py b/src/common/message_archiving.py index dd9d00687..085ee36e7 100644 --- a/src/common/message_archiving.py +++ b/src/common/message_archiving.py @@ -334,6 +334,14 @@ class ConnectionArchive136(ConnectionArchive): def _nec_archiving_changed_received(self, obj): if obj.conn.name != self.name: return + for key in ('auto', 'default'): + if key not in obj.conf: + self.archiving_136_supported = False + self.archive_auto_supported = False + self.archive_manage_supported = False + self.archive_manual_supported = False + self.archive_pref_supported = False + return True for key in ('auto', 'method_auto', 'method_local', 'method_manual', 'default'): if key in obj.conf: