In-band-registration: data form 2 xml conversion
This commit is contained in:
parent
e92710fb2f
commit
a5c34eeec9
1 changed files with 63 additions and 437 deletions
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue