浏览代码

Properly handle child nodes for api.presence.send

JC Brand 4 年之前
父节点
当前提交
e6e416306e
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/headless/plugins/caps.js
  2. 1 1
      src/headless/plugins/status.js

+ 1 - 1
src/headless/plugins/caps.js

@@ -48,7 +48,7 @@ converse.plugins.add('converse-caps', {
         XMPPStatus: {
             constructPresence () {
                 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;
             }
         }

+ 1 - 1
src/headless/plugins/status.js

@@ -261,7 +261,7 @@ converse.plugins.add('converse-status', {
                         if (!Array.isArray(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);
                 }