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:
parent
63875ae4f1
commit
3da29896df
1 changed files with 8 additions and 1 deletions
|
|
@ -483,7 +483,14 @@ class XEP_0050(object):
|
||||||
)
|
)
|
||||||
|
|
||||||
if session_id is None:
|
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)
|
form = data_form.Form.fromElement(data_elt)
|
||||||
# we add any present note to the instructions
|
# we add any present note to the instructions
|
||||||
form.instructions.extend(self._mergeNotes(notes))
|
form.instructions.extend(self._mergeNotes(notes))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue