plugin XEP-0050: form returned by completed command are now managed

This commit is contained in:
Goffi 2014-06-14 17:26:22 +02:00
commit b2c2dc5e6a

View file

@ -255,11 +255,16 @@ class XEP_0050(object):
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)