Properly handle child nodes for api.presence.send

This commit is contained in:
JC Brand 2020-12-11 15:05:55 +01:00
parent 2f244da8b1
commit e6e416306e
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ converse.plugins.add('converse-caps', {
XMPPStatus: { XMPPStatus: {
constructPresence () { constructPresence () {
const presence = this.__super__.constructPresence.apply(this, arguments); const presence = this.__super__.constructPresence.apply(this, arguments);
presence.root().cnode(createCapsNode(this.__super__._converse)); presence.root().cnode(createCapsNode(this.__super__._converse)).up();
return presence; return presence;
} }
} }

View File

@ -261,7 +261,7 @@ converse.plugins.add('converse-status', {
if (!Array.isArray(child_nodes)) { if (!Array.isArray(child_nodes)) {
child_nodes = [child_nodes]; child_nodes = [child_nodes];
} }
child_nodes.forEach(c => presence.c(c).up()); child_nodes.map(c => c?.tree() ?? c).forEach(c => presence.cnode(c).up());
} }
api.send(presence); api.send(presence);
} }