comparison src/plugins/plugin_xep_0077.py @ 761:2f8d72226bc0

core (xml_tools): dataForm*2XML renamed to dataForm*2XMLUI and now return XMLUI instead of raw XML + submit_id is managed, and session_id is returned if present
author Goffi <goffi@goffi.org>
date Tue, 24 Dec 2013 15:43:22 +0100
parents 0b914394e74f
children bfabeedbf32e
comparison
equal deleted inserted replaced
760:73a0077f80cc 761:2f8d72226bc0
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 from logging import debug, info, error 20 from logging import debug, info, error
21 from twisted.words.protocols.jabber import jid 21 from twisted.words.protocols.jabber import jid
22 from twisted.words.protocols.jabber.xmlstream import IQ 22 from twisted.words.protocols.jabber.xmlstream import IQ
23 from sat.tools.xml_tools import dataForm2XML 23 from sat.tools.xml_tools import dataForm2XMLUI
24 24
25 from wokkel import data_form 25 from wokkel import data_form
26 26
27 NS_REG = 'jabber:iq:register' 27 NS_REG = 'jabber:iq:register'
28 28
61 answer_type = "ERROR" 61 answer_type = "ERROR"
62 self.host.bridge.actionResult(answer_type, answer['id'], answer_data, profile) 62 self.host.bridge.actionResult(answer_type, answer['id'], answer_data, profile)
63 return 63 return
64 64
65 form = data_form.Form.fromElement(x_elem) 65 form = data_form.Form.fromElement(x_elem)
66 xml_data = dataForm2XML(form) 66 xml_data = dataForm2XMLUI(form, "").toXml()
67 self.host.bridge.actionResult("XMLUI", answer['id'], {"target": answer["from"], "type": "registration", "xml": xml_data}, profile) 67 self.host.bridge.actionResult("XMLUI", answer['id'], {"target": answer["from"], "type": "registration", "xml": xml_data}, profile)
68 68
69 def reg_err(self, failure, profile): 69 def reg_err(self, failure, profile):
70 """Called when something is wrong with registration""" 70 """Called when something is wrong with registration"""
71 info(_("Registration failure: %s") % str(failure.value)) 71 info(_("Registration failure: %s") % str(failure.value))