changeset 1071:eef1f200d733

plugin XEP-0050: form returned by completed command are now managed
author Goffi <goffi@goffi.org>
date Sat, 14 Jun 2014 17:26:22 +0200
parents ad023e60da8c
children d123d61976c8
files src/plugins/plugin_xep_0050.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0050.py	Sat Jun 14 17:25:08 2014 +0200
+++ b/src/plugins/plugin_xep_0050.py	Sat Jun 14 17:26:22 2014 +0200
@@ -255,11 +255,16 @@
         if status in [XEP_0050.STATUS.COMPLETED, XEP_0050.STATUS.CANCELED]:
             # the command session is finished, we purge our session
             del self.requesting[session_id]
-            return None
+            if status == XEP_0050.STATUS.COMPLETED:
+                session_id = None
+            else:
+                return None
         remote_session_id = command_elt.getAttribute('sessionid')
         if remote_session_id:
             session_data['remote_id'] = remote_session_id
         data_elt = command_elt.elements(data_form.NS_X_DATA, 'x').next()
+        if session_id is None:
+            return xml_tools.dataFormResult2XMLUI(data_elt)
         form = data_form.Form.fromElement(data_elt)
         return  xml_tools.dataForm2XMLUI(form, self.__requesting_id, session_id=session_id)