Author: bct Date: 2007-08-20 21:02:58 +0200 (Mon, 20 Aug 2007) New Revision: 8518
Modified: branches/e2e_encryption/src/common/connection_handlers.py branches/e2e_encryption/src/common/stanza_session.py branches/e2e_encryption/src/common/xmpp/protocol.py Log: advertise xep-0116 support via disco
Modified: branches/e2e_encryption/src/common/connection_handlers.py =================================================================== --- branches/e2e_encryption/src/common/connection_handlers.py 2007-08-20 18:46:54 UTC (rev 8517) +++ branches/e2e_encryption/src/common/connection_handlers.py 2007-08-20 19:02:58 UTC (rev 8518) @@ -733,6 +733,7 @@ q.addChild('feature', attrs = {'var': common.xmpp.NS_MUC}) q.addChild('feature', attrs = {'var': common.xmpp.NS_COMMANDS}) q.addChild('feature', attrs = {'var': common.xmpp.NS_DISCO_INFO}) + q.addChild('feature', attrs = {'var': common.xmpp.NS_ESESSION_INIT})
if (node is None or extension == 'cstates') and gajim.config.get('outgoing_chat_state_notifactions') != 'disabled': q.addChild('feature', attrs = {'var': common.xmpp.NS_CHATSTATES}) @@ -1220,7 +1221,7 @@
def _InitE2ECB(self, con, stanza, session): gajim.log.debug('InitE2ECB') - init = stanza.getTag(name='init', namespace='http://www.xmpp.org/extensions/xep-0116.html#ns-init') + init = stanza.getTag(name='init', namespace=common.xmpp.NS_ESESSION_INIT) form = common.xmpp.DataForm(node=init.getTag('x'))
self.dispatch('SESSION_NEG', (stanza.getFrom(), session, form)) @@ -1448,7 +1449,8 @@ common.xmpp.NS_FEATURE: self._FeatureNegCB(con, msg, session) return - if msg.getTag('init') and msg.getTag('init').namespace == 'http://www.xmpp.org/extensions/xep-0116.html#ns-init': + if msg.getTag('init') and msg.getTag('init').namespace == \ + common.xmpp.NS_ESESSION_INIT: self._InitE2ECB(con, msg, session) encrypted = False
Modified: branches/e2e_encryption/src/common/stanza_session.py =================================================================== --- branches/e2e_encryption/src/common/stanza_session.py 2007-08-20 18:46:54 UTC (rev 8517) +++ branches/e2e_encryption/src/common/stanza_session.py 2007-08-20 19:02:58 UTC (rev 8518) @@ -730,7 +730,7 @@ response = xmpp.Message()
init = response.NT.init - init.setNamespace('http://www.xmpp.org/extensions/xep-0116.html#ns-init') + init.setNamespace(xmpp.NS_ESESSION_INIT)
x = xmpp.DataForm(typ='result')
Modified: branches/e2e_encryption/src/common/xmpp/protocol.py =================================================================== --- branches/e2e_encryption/src/common/xmpp/protocol.py 2007-08-20 18:46:54 UTC (rev 8517) +++ branches/e2e_encryption/src/common/xmpp/protocol.py 2007-08-20 19:02:58 UTC (rev 8518) @@ -45,6 +45,7 @@ NS_DISCO_INFO =NS_DISCO+'#info' NS_DISCO_ITEMS =NS_DISCO+'#items' NS_ENCRYPTED ='jabber:x:encrypted' # JEP-0027 +NS_ESESSION_INIT='http://www.xmpp.org/extensions/xep-0116.html#ns-init' NS_EVENT ='jabber:x:event' # JEP-0022 NS_FEATURE ='http://jabber.org/protocol/feature-neg' NS_FILE ='http://jabber.org/protocol/si/profile/file-transfer' # JEP-0096