# HG changeset patch # User Yann Leboulanger # Date 1266143077 -3600 # Node ID 86f514ca1093e0578f7503b24dc1e55edab41232 # Parent cbcb30a77ac6848858d986dffdbd0852a4d4c15b [Mattj] Fix connection to facebook server that don't understand ver="" in roster query. diff -r cbcb30a77ac6 -r 86f514ca1093 src/common/connection_handlers.py --- a/src/common/connection_handlers.py Fri Jan 29 22:29:25 2010 +0100 +++ b/src/common/connection_handlers.py Sun Feb 14 11:24:37 2010 +0100 @@ -1182,9 +1182,14 @@ 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, - 'roster_version') + 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: diff -r cbcb30a77ac6 -r 86f514ca1093 src/common/xmpp/protocol.py --- a/src/common/xmpp/protocol.py Fri Jan 29 22:29:25 2010 +0100 +++ b/src/common/xmpp/protocol.py Sun Feb 14 11:24:37 2010 +0100 @@ -86,6 +86,7 @@ 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' diff -r cbcb30a77ac6 -r 86f514ca1093 src/common/xmpp/roster_nb.py --- a/src/common/xmpp/roster_nb.py Fri Jan 29 22:29:25 2010 +0100 +++ b/src/common/xmpp/roster_nb.py Sun Feb 14 11:24:37 2010 +0100 @@ -36,7 +36,7 @@ You can also use mapping interface for access to the internal representation of contacts in roster. ''' - def __init__(self, version=''): + def __init__(self, version=None): ''' Init internal variables. ''' PlugIn.__init__(self) self.version = version @@ -52,7 +52,8 @@ elif not force: 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)