# HG changeset patch # User Emmanuel Gil Peyrot # Date 1277811487 -7200 # Node ID 4c93e76fa371757c50c5d82f9f7490f8befe57d1 # Parent 80e607c0b39ea630f51332e4f62d240243679a15 Ensure that the creator of a node is the default owner; don’t crash when sending metadata. diff --git a/nodes.js b/nodes.js --- a/nodes.js +++ b/nodes.js @@ -34,7 +34,11 @@ exports.Node = function(params) { this.items = {}; if (config.enabled('subscribe')) this.subscribers = {}; + this.owner = []; + if (params && params['pubsub#creator']) + this.owner.push(params['pubsub#creator']); + if (config.enabled('publisher-affiliation')) this.publisher = []; if (config.enabled('publish-only-affiliation')) diff --git a/psgxs.js b/psgxs.js --- a/psgxs.js +++ b/psgxs.js @@ -92,7 +92,7 @@ function onIq(stanza) { // SECTION 5.4 if (config.enabled('meta-data')) { - var x = forms.build('result', 'meta-data', storage.getMetadata(nodeID), true); + var x = forms.build('result', 'node_metadata', storage.getMetadata(nodeID), true); if (x) q.cx(x); } @@ -669,7 +669,7 @@ function onIq(stanza) { var nodeID = pubsub.getChild('create').getAttribute('node'); if (!nodeID || nodeID == '') { - if (config.enabled('instant-nodes')) + if (!config.enabled('instant-nodes')) return makeError(response, errors.owner.create.instant_nodes_not_supported.n); nodeID = utils.makeRandomId(); instant = true; @@ -961,7 +961,7 @@ function sendNotifs(notifs, type, nodeID args.jid = attr; } var affiliations = xmpp.stanza('affiliations', {node: nodeID}) - .c('affiliation', {args}); + .c('affiliation', args); ev.cx(affiliations); } else if (type == 'collection') { var collection = xmpp.stanza('collection', {node: nodeID});