Mercurial > psgxs
comparison modules/mod_publish.js @ 35:6697f394301f
Replace util with fdsq to work around a stupid bug.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 10 Nov 2010 01:30:03 +0100 |
parents | dcf1f09f8cee |
children | 4c808bfe0658 |
comparison
equal
deleted
inserted
replaced
34:dcf1f09f8cee | 35:6697f394301f |
---|---|
1 var config = require('../configuration'); | 1 var config = require('../configuration'); |
2 var storage = require('../storage'); | 2 var storage = require('../storage'); |
3 var notifs = require('../notifs'); | 3 var notifs = require('../notifs'); |
4 var errors = require('../errors'); | 4 var errors = require('../errors'); |
5 var utils = require('../util'); | 5 var fdsq = require('../fdsq'); |
6 var toBareJID = utils.toBareJID; | 6 var toBareJID = fdsq.toBareJID; |
7 var NS = require('../namespaces'); | 7 var NS = require('../namespaces'); |
8 | 8 |
9 // SECTION 7.1: Publish an Item to a Node | 9 // SECTION 7.1: Publish an Item to a Node |
10 exports.publish = { | 10 exports.publish = { |
11 type: 'set', | 11 type: 'set', |
36 | 36 |
37 var item = request.getChild('item'); | 37 var item = request.getChild('item'); |
38 var itemID = item.getAttribute('id'); | 38 var itemID = item.getAttribute('id'); |
39 if (!config.enabled('item-ids') && itemID) | 39 if (!config.enabled('item-ids') && itemID) |
40 return makeError(response, errors.itemid_required.n); | 40 return makeError(response, errors.itemid_required.n); |
41 itemID = itemID? itemID: utils.makeRandomId(); | 41 itemID = itemID? itemID: fdsq.makeRandomId(); |
42 | 42 |
43 if (item.tags.length != 1) | 43 if (item.tags.length != 1) |
44 return makeError(response, errors.pub.publish.bad_payload.n); | 44 return makeError(response, errors.pub.publish.bad_payload.n); |
45 | 45 |
46 var conf = storage.getConfiguration(nodeID); | 46 var conf = storage.getConfiguration(nodeID); |