# HG changeset patch # User Goffi # Date 1620221853 -7200 # Node ID fad3b3ffa8febc6e3260c19d20c7a81973e6adee # Parent 698579bedd6fccb55036a3e18a7316fa84c3c88f plugin XEP-0050: show notes when there is a data form on completed command: Notes are now added on completed command, as text widgets. diff -r 698579bedd6f -r fad3b3ffa8fe sat/plugins/plugin_xep_0050.py --- a/sat/plugins/plugin_xep_0050.py Wed May 05 15:37:33 2021 +0200 +++ b/sat/plugins/plugin_xep_0050.py Wed May 05 15:37:33 2021 +0200 @@ -483,7 +483,14 @@ ) 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))