| 1221 | | def _FeatureNegCB(self, con, stanza, session): |
| 1222 | | gajim.log.debug('FeatureNegCB') |
| 1223 | | feature = stanza.getTag(name='feature', namespace=common.xmpp.NS_FEATURE) |
| 1224 | | form = common.xmpp.DataForm(node=feature.getTag('x')) |
| 1225 | | |
| 1226 | | if form['FORM_TYPE'] == 'urn:xmpp:ssn': |
| 1227 | | self.dispatch('SESSION_NEG', (stanza.getFrom(), session, form)) |
| 1228 | | else: |
| 1229 | | reply = stanza.buildReply() |
| 1230 | | reply.setType('error') |
| 1231 | | |
| 1232 | | reply.addChild(feature) |
| 1233 | | reply.addChild(node=common.xmpp.ErrorNode('service-unavailable', typ='cancel')) |
| 1234 | | |
| 1235 | | con.send(reply) |
| 1236 | | |
| 1237 | | raise common.xmpp.NodeProcessed |
| 1238 | | |
| 1239 | | def _InitE2ECB(self, con, stanza, session): |
| 1240 | | gajim.log.debug('InitE2ECB') |
| 1241 | | init = stanza.getTag(name='init', namespace=common.xmpp.NS_ESESSION_INIT) |
| 1242 | | form = common.xmpp.DataForm(node=init.getTag('x')) |
| 1243 | | |
| 1244 | | self.dispatch('SESSION_NEG', (stanza.getFrom(), session, form)) |
| 1245 | | |
| 1246 | | raise common.xmpp.NodeProcessed |
| 1247 | | |
| 1720 | | self._FeatureNegCB(con, msg, session) |
| 1721 | | return |
| | 1693 | feature = msg.getTag(name='feature', namespace=common.xmpp.NS_FEATURE) |
| | 1694 | form = common.xmpp.DataForm(node=feature.getTag('x')) |
| | 1695 | |
| | 1696 | if form['FORM_TYPE'] == 'urn:xmpp:ssn': |
| | 1697 | session.handle_negotiation(form) |
| | 1698 | else: |
| | 1699 | reply = msg.buildReply() |
| | 1700 | reply.setType('error') |
| | 1701 | |
| | 1702 | reply.addChild(feature) |
| | 1703 | err = common.xmpp.ErrorNode('service-unavailable', typ='cancel') |
| | 1704 | reply.addChild(node=err) |
| | 1705 | |
| | 1706 | con.send(reply) |
| | 1707 | |
| | 1708 | raise common.xmpp.NodeProcessed |
| | 1709 | |
| | 1710 | return |
| | 1711 | |