plugin XEP-0050: show notes when there is a data form on completed command:

Notes are now added on completed command, as text widgets.
This commit is contained in:
Goffi 2021-05-05 15:37:33 +02:00
commit 3da29896df

View file

@ -483,7 +483,14 @@ class XEP_0050(object):
)
if session_id is None:
return xml_tools.dataFormEltResult2XMLUI(data_elt)
xmlui = xml_tools.dataFormEltResult2XMLUI(data_elt)
if notes:
for level, note in notes:
if level != "info":
note = f"[{level}] {note}"
xmlui.addWidget("text", note)
return xmlui
form = data_form.Form.fromElement(data_elt)
# we add any present note to the instructions
form.instructions.extend(self._mergeNotes(notes))