Mercurial > psgxs
diff modules/mod_publish.js @ 33:62cbb1c49bc5
Fix publish; add owner metadata field; add HTTP module and Atom HTTP module.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 05 Nov 2010 14:01:45 +0100 |
parents | b2faacfefb90 |
children | dcf1f09f8cee |
line wrap: on
line diff
--- a/modules/mod_publish.js +++ b/modules/mod_publish.js @@ -1,10 +1,11 @@ var config = require('../configuration'); var storage = require('../storage'); +var notifs = require('../notifs'); var toBareJID = require('../util').toBareJID; var NS = require('../namespaces'); // SECTION 7.1: Publish an Item to a Node -exports.retrieveSub = { +exports.publish = { type: 'set', child: 'pubsub', ns: NS.PUBSUB, @@ -41,7 +42,7 @@ exports.retrieveSub = { return makeError(response, errors.pub.publish.bad_payload.n); var conf = storage.getConfiguration(nodeID); - var publishOptions = pubsub.getChild('publish-options'); + /*var publishOptions = pubsub.getChild('publish-options'); if (publishOptions && config.enabled('publish-options')) { var x = publishOptions.getChild('x', 'jabber:x:data'); if (!x || x.getAttribute('type') != 'submit') @@ -50,11 +51,11 @@ exports.retrieveSub = { var form = forms.parse(x, true); if (form.access_model != conf['pubsub#access_model'] && !autocreate) return makeError(response, errors.pub.configuration.precondition.n); - } + }*/ if (!config.enabled('persistent-items')) { - var notifs = storage.purgeNode(nodeID); - if (typeof notifs == 'number') + var notifications = storage.purgeNode(nodeID); + if (typeof notifications == 'number') return makeError(response, r); } @@ -90,7 +91,7 @@ exports.retrieveSub = { } // SECTION 7.2: Delete an Item from a Node -exports.retrieveSub = { +exports.retract = { type: 'set', child: 'pubsub', ns: NS.PUBSUB,