In-band-registration: data form 2 xml conversion

This commit is contained in:
Goffi 2009-12-08 09:54:44 +01:00
commit a5c34eeec9

View file

@ -23,8 +23,11 @@ from logging import debug, info, error
from twisted.words.protocols.jabber import client, jid, xmlstream, error
from twisted.words.protocols.jabber.xmlstream import IQ
from twisted.internet import reactor
from tools.xml_tools import XMLTools
import pdb
from wokkel import data_form
NS_REG = 'jabber:iq:register'
PLUGIN_INFO = {
@ -46,6 +49,9 @@ class XEP_0077():
def reg_ok(self, answer):
"""Called after the first get IQ"""
print "answer:",answer
form = data_form.Form.fromElement(answer.firstChildElement().firstChildElement())
xml_data = XMLTools.dataForm2xml(form)
self.host.bridge.actionResult("FORM", answer['id'], {"type":"registration", "xml":xml_data})
def reg_err(self, failure):
"""Called when something is wrong with registration"""