|
@@ -8,7 +8,7 @@ const { Strophe, u } = converse.env;
|
|
|
*/
|
|
|
export function parseForCommands (stanza) {
|
|
|
const items = sizzle(`query[xmlns="${Strophe.NS.DISCO_ITEMS}"][node="${Strophe.NS.ADHOC}"] item`, stanza);
|
|
|
- return items.map(u.getAttributes)
|
|
|
+ return items.map(u.getAttributes);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -20,9 +20,10 @@ export function getCommandFields (iq, jid) {
|
|
|
const data = {
|
|
|
sessionid: cmd_el.getAttribute('sessionid'),
|
|
|
instructions: sizzle('x[type="form"][xmlns="jabber:x:data"] instructions', cmd_el).pop()?.textContent,
|
|
|
- fields: sizzle('x[type="form"][xmlns="jabber:x:data"] field', cmd_el)
|
|
|
- .map(f => u.xForm2TemplateResult(f, cmd_el, { domain: jid })),
|
|
|
- actions: Array.from(cmd_el.querySelector('actions')?.children).map((a) => a.nodeName.toLowerCase()) ?? []
|
|
|
- }
|
|
|
+ fields: sizzle('x[type="form"][xmlns="jabber:x:data"] field', cmd_el).map((f) =>
|
|
|
+ u.xForm2TemplateResult(f, cmd_el, { domain: jid })
|
|
|
+ ),
|
|
|
+ actions: Array.from(cmd_el.querySelector('actions')?.children ?? []).map((a) => a.nodeName.toLowerCase()),
|
|
|
+ };
|
|
|
return data;
|
|
|
}
|