check server features in correct stanza

This commit is contained in:
Yann Leboulanger 2010-09-03 11:29:15 +02:00
parent ea957fe015
commit 8d6ff98ee9
1 changed files with 26 additions and 25 deletions

View File

@ -359,32 +359,33 @@ class ConnectionDisco:
'pep':
self.pep_supported = True
break
if features.__contains__(common.xmpp.NS_VCARD):
self.vcard_supported = True
if features.__contains__(common.xmpp.NS_PUBSUB):
self.pubsub_supported = True
if features.__contains__(common.xmpp.NS_PUBSUB_PUBLISH_OPTIONS):
self.pubsub_publish_options_supported = True
else:
# Remove stored bookmarks accessible to everyone.
our_jid = gajim.get_jid_from_account(self.name)
self.send_pb_purge(our_jid, 'storage:bookmarks')
self.send_pb_delete(our_jid, 'storage:bookmarks')
if features.__contains__(common.xmpp.NS_ARCHIVE):
self.archiving_supported = True
if features.__contains__(common.xmpp.NS_ARCHIVE_AUTO):
self.archive_auto_supported = True
if features.__contains__(common.xmpp.NS_ARCHIVE_MANAGE):
self.archive_manage_supported = True
if features.__contains__(common.xmpp.NS_ARCHIVE_MANUAL):
self.archive_manual_supported = True
if features.__contains__(common.xmpp.NS_ARCHIVE_PREF):
self.archive_pref_supported = True
if features.__contains__(common.xmpp.NS_VCARD):
self.vcard_supported = True
if features.__contains__(common.xmpp.NS_PUBSUB):
self.pubsub_supported = True
if features.__contains__(
common.xmpp.NS_PUBSUB_PUBLISH_OPTIONS):
self.pubsub_publish_options_supported = True
else:
# Remove stored bookmarks accessible to everyone.
our_jid = gajim.get_jid_from_account(self.name)
self.send_pb_purge(our_jid, 'storage:bookmarks')
self.send_pb_delete(our_jid, 'storage:bookmarks')
if features.__contains__(common.xmpp.NS_ARCHIVE):
self.archiving_supported = True
if features.__contains__(common.xmpp.NS_ARCHIVE_AUTO):
self.archive_auto_supported = True
if features.__contains__(common.xmpp.NS_ARCHIVE_MANAGE):
self.archive_manage_supported = True
if features.__contains__(common.xmpp.NS_ARCHIVE_MANUAL):
self.archive_manual_supported = True
if features.__contains__(common.xmpp.NS_ARCHIVE_PREF):
self.archive_pref_supported = True
if features.__contains__(common.xmpp.NS_BYTESTREAM):
our_jid = helpers.parse_jid(gajim.get_jid_from_account(self.name) +\
'/' + self.server_resource)
our_jid = helpers.parse_jid(gajim.get_jid_from_account(
self.name) + '/' + self.server_resource)
gajim.proxy65_manager.resolve(jid, self.connection, our_jid,
self.name)
self.name)
if features.__contains__(common.xmpp.NS_MUC) and is_muc:
type_ = transport_type or 'jabber'
self.muc_jid[type_] = jid
@ -2350,4 +2351,4 @@ ConnectionJingle, ConnectionIBBytestream):
con.RegisterHandler('iq', self._ResultCB, 'result')
con.RegisterHandler('presence', self._StanzaArrivedCB)
con.RegisterHandler('message', self._StanzaArrivedCB)
con.RegisterHandler('unknown', self._StreamCB, 'urn:ietf:params:xml:ns:xmpp-streams', xmlns='http://etherx.jabber.org/streams')
con.RegisterHandler('unknown', self._StreamCB, 'urn:ietf:params:xml:ns:xmpp-streams', xmlns='http://etherx.jabber.org/streams')