[Mattj] Fix connection to facebook server that don't understand ver="" in roster query. Fixes #5600

This commit is contained in:
Yann Leboulanger 2010-02-11 18:57:39 +01:00
parent 708d94a310
commit 23f73004db
3 changed files with 10 additions and 3 deletions

View File

@ -636,9 +636,14 @@ class ConnectionVcard:
else:
if iq_obj.getErrorCode() not in ('403', '406', '404'):
self.private_storage_supported = False
# We can now continue connection by requesting the roster
version = gajim.config.get_per('accounts', self.name,
version = None
if con.Stream.features.getTag('ver',
namespace=common.xmpp.NS_ROSTER_VER):
version = gajim.config.get_per('accounts', self.name,
'roster_version')
iq_id = self.connection.initRoster(version=version)
self.awaiting_answers[iq_id] = (ROSTER_ARRIVED, )
elif self.awaiting_answers[id_][0] == ROSTER_ARRIVED:

View File

@ -96,6 +96,7 @@ NS_PUBSUB_OWNER ='http://jabber.org/protocol/pubsub#owner'
NS_REGISTER ='jabber:iq:register'
NS_ROSTER ='jabber:iq:roster'
NS_ROSTERX ='http://jabber.org/protocol/rosterx' # XEP-0144
NS_ROSTER_VER ='urn:xmpp:features:rosterver' # XEP-0273
NS_RPC ='jabber:iq:rpc' # XEP-0009
NS_SASL ='urn:ietf:params:xml:ns:xmpp-sasl'
NS_SEARCH ='jabber:iq:search'

View File

@ -38,7 +38,7 @@ class NonBlockingRoster(PlugIn):
internal representation of contacts in roster
"""
def __init__(self, version=''):
def __init__(self, version=None):
"""
Init internal variables
"""
@ -60,7 +60,8 @@ class NonBlockingRoster(PlugIn):
return
iq = Iq('get', NS_ROSTER)
iq.setTagAttr('query', 'ver', self.version)
if self.version is not None:
iq.setTagAttr('query', 'ver', self.version)
id_ = self._owner.getAnID()
iq.setID(id_)
self._owner.send(iq)