From 260f1541d1b6eed477eefd02e54e194dd904594f Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 4 Aug 2009 17:57:12 +0200 Subject: [PATCH] request privacy lists after disco result --- src/common/connection.py | 4 +++- src/common/connection_handlers.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/connection.py b/src/common/connection.py index 5aada690c..c155bd1a2 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -157,6 +157,8 @@ class Connection(ConnectionHandlers): else: self.pingalives = 0 self.privacy_rules_supported = False + # Used to ask privacy only once at connection + self.privacy_rules_requested = False self.blocked_list = [] self.blocked_contacts = [] self.blocked_groups = [] @@ -1035,7 +1037,7 @@ class Connection(ConnectionHandlers): self.connection.onreceive(None) self.discoverInfo(gajim.config.get_per('accounts', self.name, 'hostname'), id_prefix='Gajim_') - self._request_privacy() + self.privacy_rules_requested = False def _request_privacy(self): iq = common.xmpp.Iq('get', common.xmpp.NS_PRIVACY, xmlns = '') diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 203faddad..153d9138a 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -914,6 +914,9 @@ class ConnectionDisco: self.available_transports[transport_type].append(jid) else: self.available_transports[transport_type] = [jid] + if not self.privacy_rules_requested: + self.privacy_rules_requested = True + self._request_privacy() self.dispatch('AGENT_INFO_INFO', (jid, node, identities, features, data))