Mercurial > psgxs
comparison psgxs.js @ 4:4c93e76fa371
Ensure that the creator of a node is the default owner; don’t crash
when sending metadata.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 29 Jun 2010 13:38:07 +0200 |
parents | 80e607c0b39e |
children | 2bcadb0531f4 |
comparison
equal
deleted
inserted
replaced
3:80e607c0b39e | 4:4c93e76fa371 |
---|---|
90 q.s('identity', {category: 'pubsub', type: type}); | 90 q.s('identity', {category: 'pubsub', type: type}); |
91 q.s('feature', {'var': 'http://jabber.org/protocol/pubsub'}); | 91 q.s('feature', {'var': 'http://jabber.org/protocol/pubsub'}); |
92 | 92 |
93 // SECTION 5.4 | 93 // SECTION 5.4 |
94 if (config.enabled('meta-data')) { | 94 if (config.enabled('meta-data')) { |
95 var x = forms.build('result', 'meta-data', storage.getMetadata(nodeID), true); | 95 var x = forms.build('result', 'node_metadata', storage.getMetadata(nodeID), true); |
96 if (x) | 96 if (x) |
97 q.cx(x); | 97 q.cx(x); |
98 } | 98 } |
99 response.cx(q); | 99 response.cx(q); |
100 | 100 |
667 | 667 |
668 var instant = false; | 668 var instant = false; |
669 | 669 |
670 var nodeID = pubsub.getChild('create').getAttribute('node'); | 670 var nodeID = pubsub.getChild('create').getAttribute('node'); |
671 if (!nodeID || nodeID == '') { | 671 if (!nodeID || nodeID == '') { |
672 if (config.enabled('instant-nodes')) | 672 if (!config.enabled('instant-nodes')) |
673 return makeError(response, errors.owner.create.instant_nodes_not_supported.n); | 673 return makeError(response, errors.owner.create.instant_nodes_not_supported.n); |
674 nodeID = utils.makeRandomId(); | 674 nodeID = utils.makeRandomId(); |
675 instant = true; | 675 instant = true; |
676 } | 676 } |
677 if (storage.existsNode(nodeID)) | 677 if (storage.existsNode(nodeID)) |
959 args.affiliation = attr; | 959 args.affiliation = attr; |
960 else if (i == 'jid') | 960 else if (i == 'jid') |
961 args.jid = attr; | 961 args.jid = attr; |
962 } | 962 } |
963 var affiliations = xmpp.stanza('affiliations', {node: nodeID}) | 963 var affiliations = xmpp.stanza('affiliations', {node: nodeID}) |
964 .c('affiliation', {args}); | 964 .c('affiliation', args); |
965 ev.cx(affiliations); | 965 ev.cx(affiliations); |
966 } else if (type == 'collection') { | 966 } else if (type == 'collection') { |
967 var collection = xmpp.stanza('collection', {node: nodeID}); | 967 var collection = xmpp.stanza('collection', {node: nodeID}); |
968 if (a1 == 'associate') | 968 if (a1 == 'associate') |
969 collection.cx('associate', {node: nodeID}); | 969 collection.cx('associate', {node: nodeID}); |