request archiving preferences only if server announce it supports it, and don't think it supports it while it's buggy. Fixes #7839

This commit is contained in:
Yann Leboulanger 2015-09-30 20:00:48 +02:00
parent 1503eb6152
commit 5b513f763e
2 changed files with 17 additions and 9 deletions

View File

@ -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:

View File

@ -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: