correctly detect vcard support of server. Fixes #5233

This commit is contained in:
Yann Leboulanger 2009-08-28 13:41:36 +02:00
parent 3a09185cb9
commit 54fa89af23
2 changed files with 6 additions and 7 deletions

View File

@ -187,7 +187,7 @@ class Connection(ConnectionHandlers):
self.muc_jid = {} # jid of muc server for each transport type self.muc_jid = {} # jid of muc server for each transport type
self.available_transports = {} # list of available transports on this self.available_transports = {} # list of available transports on this
# server {'icq': ['icq.server.com', 'icq2.server.com'], } # server {'icq': ['icq.server.com', 'icq2.server.com'], }
self.vcard_supported = True self.vcard_supported = False
self.private_storage_supported = True self.private_storage_supported = True
self.streamError = '' self.streamError = ''
# END __init__ # END __init__

View File

@ -897,6 +897,8 @@ class ConnectionDisco:
gajim.interface.roster.music_track_changed(listener, gajim.interface.roster.music_track_changed(listener,
track, self.name) track, self.name)
break break
if features.__contains__(common.xmpp.NS_VCARD):
self.vard_supported = True
if features.__contains__(common.xmpp.NS_PUBSUB): if features.__contains__(common.xmpp.NS_PUBSUB):
self.pubsub_supported = True self.pubsub_supported = True
if features.__contains__(common.xmpp.NS_PUBSUB_PUBLISH_OPTIONS): 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 # We do as if it comes from the fake_jid
frm = groupchat_jid frm = groupchat_jid
our_jid = gajim.get_jid_from_account(self.name) 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 not iq_obj.getTag('vCard') or iq_obj.getType() == 'error':
if frm and frm != our_jid: if frm and frm != our_jid:
# Write an empty file # Write an empty file
@ -2638,6 +2636,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
self.connection.send(p) self.connection.send(p)
self.priority = priority self.priority = priority
self.dispatch('STATUS', show) self.dispatch('STATUS', show)
if self.vcard_supported:
# ask our VCard # ask our VCard
self.request_vcard(None) self.request_vcard(None)