From 54fa89af236070f5698abfa583577d127bd43c06 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 28 Aug 2009 13:41:36 +0200 Subject: [PATCH] correctly detect vcard support of server. Fixes #5233 --- src/common/connection.py | 2 +- src/common/connection_handlers.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 13c863371..d58c6aae5 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -187,7 +187,7 @@ class Connection(ConnectionHandlers): self.muc_jid = {} # jid of muc server for each transport type self.available_transports = {} # list of available transports on this # server {'icq': ['icq.server.com', 'icq2.server.com'], } - self.vcard_supported = True + self.vcard_supported = False self.private_storage_supported = True self.streamError = '' # END __init__ diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 153d9138a..ee32aeab4 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -897,6 +897,8 @@ class ConnectionDisco: gajim.interface.roster.music_track_changed(listener, track, self.name) break + if features.__contains__(common.xmpp.NS_VCARD): + self.vard_supported = True if features.__contains__(common.xmpp.NS_PUBSUB): self.pubsub_supported = True if features.__contains__(common.xmpp.NS_PUBSUB_PUBLISH_OPTIONS): @@ -1136,10 +1138,6 @@ class ConnectionVcard: # We do as if it comes from the fake_jid frm = groupchat_jid our_jid = gajim.get_jid_from_account(self.name) - if iq_obj.getType() == 'error' and jid == our_jid: - # our server doesn't support vcard - log.debug('xxx error xxx') - self.vcard_supported = False if not iq_obj.getTag('vCard') or iq_obj.getType() == 'error': if frm and frm != our_jid: # Write an empty file @@ -2638,8 +2636,9 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, self.connection.send(p) self.priority = priority self.dispatch('STATUS', show) - # ask our VCard - self.request_vcard(None) + if self.vcard_supported: + # ask our VCard + self.request_vcard(None) # Get bookmarks from private namespace self.get_bookmarks()