Mercurial > libervia-backend
comparison plugins/plugin_xep_0077.py @ 36:6491b7956c80
wix: Form submitting, first draft
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 14 Dec 2009 02:11:05 +1100 |
parents | c45deebb40a5 |
children | a61beb21d16d |
comparison
equal
deleted
inserted
replaced
35:c45deebb40a5 | 36:6491b7956c80 |
---|---|
34 "name": "XEP 0077 Plugin", | 34 "name": "XEP 0077 Plugin", |
35 "import_name": "XEP_0077", | 35 "import_name": "XEP_0077", |
36 "type": "XEP", | 36 "type": "XEP", |
37 "dependencies": [], | 37 "dependencies": [], |
38 "main": "XEP_0077", | 38 "main": "XEP_0077", |
39 "description": """Implementation of SI File Transfert""" | 39 "description": """Implementation of in-band registration""" |
40 } | 40 } |
41 | 41 |
42 class XEP_0077(): | 42 class XEP_0077(): |
43 | 43 |
44 def __init__(self, host): | 44 def __init__(self, host): |
47 host.bridge.addMethod("in_band_register", ".communication", in_sign='s', out_sign='s', method=self.in_band_register) | 47 host.bridge.addMethod("in_band_register", ".communication", in_sign='s', out_sign='s', method=self.in_band_register) |
48 | 48 |
49 def reg_ok(self, answer): | 49 def reg_ok(self, answer): |
50 """Called after the first get IQ""" | 50 """Called after the first get IQ""" |
51 form = data_form.Form.fromElement(answer.firstChildElement().firstChildElement()) | 51 form = data_form.Form.fromElement(answer.firstChildElement().firstChildElement()) |
52 pdb.set_trace() | |
52 xml_data = XMLTools.dataForm2xml(form) | 53 xml_data = XMLTools.dataForm2xml(form) |
53 self.host.bridge.actionResult("FORM", answer['id'], {"type":"registration", "xml":xml_data}) | 54 self.host.bridge.actionResult("FORM", answer['id'], {"target":answer["from"], "type":"registration", "xml":xml_data}) |
54 | 55 |
55 def reg_err(self, failure): | 56 def reg_err(self, failure): |
56 """Called when something is wrong with registration""" | 57 """Called when something is wrong with registration""" |
57 info ("Registration failure: %s" % str(failure.value)) | 58 info ("Registration failure: %s" % str(failure.value)) |
58 answer_data = {} | 59 answer_data = {} |