diff src/plugins/plugin_xep_0055.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 7c806491c76a
children bfabeedbf32e
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0055.py	Tue Dec 24 15:19:18 2013 +0100
+++ b/src/plugins/plugin_xep_0055.py	Tue Dec 24 15:43:22 2013 +0100
@@ -22,7 +22,7 @@
 from twisted.words.protocols.jabber import jid
 from wokkel import data_form
 from sat.core.exceptions import DataError
-from sat.tools.xml_tools import dataForm2XML, dataFormResult2XML
+from sat.tools.xml_tools import dataForm2XMLUI, dataFormResult2XMLUI
 
 NS_SEARCH = 'jabber:iq:search'
 
@@ -79,7 +79,7 @@
             info(_("No data form found"))
             raise NotImplementedError("Only search through data form is implemented so far")
         parsed_form = data_form.Form.fromElement(form_elt)
-        return dataForm2XML(parsed_form)
+        return dataForm2XMLUI(parsed_form, "").toXml()
 
     def _fieldsErr(self, failure, profile):
         """ Called when something is wrong with fields request """
@@ -119,7 +119,7 @@
         except StopIteration:
             info(_("No data form found"))
             raise NotImplementedError("Only search through data form is implemented so far")
-        xmlui = dataFormResult2XML(form_elt)
+        xmlui = dataFormResult2XMLUI(form_elt).toXml()
         print "=== XMLUI ===\n%s\n\n" %  xmlui
         return xmlui