Mercurial > psgxs
comparison modules/mod_owner.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 | 8735fc6f6f53 |
children | bc717575e66a |
comparison
equal
deleted
inserted
replaced
34:dcf1f09f8cee | 35:6697f394301f |
---|---|
2 var storage = require('../storage'); | 2 var storage = require('../storage'); |
3 var forms = require('../forms'); | 3 var forms = require('../forms'); |
4 var notifs = require('../notifs'); | 4 var notifs = require('../notifs'); |
5 var errors = require('../errors'); | 5 var errors = require('../errors'); |
6 var makeError = errors.makeError; | 6 var makeError = errors.makeError; |
7 var utils = require('../util'); | 7 var fdsq = require('../fdsq'); |
8 var toBareJID = utils.toBareJID; | 8 var toBareJID = fdsq.toBareJID; |
9 var NS = require('../namespaces'); | 9 var NS = require('../namespaces'); |
10 | 10 |
11 // SECTION 8.1: Create a Node | 11 // SECTION 8.1: Create a Node |
12 exports.create = { | 12 exports.create = { |
13 type: 'set', | 13 type: 'set', |
22 | 22 |
23 var nodeID = request.getAttribute('node'); | 23 var nodeID = request.getAttribute('node'); |
24 if (!nodeID || nodeID == '') { | 24 if (!nodeID || nodeID == '') { |
25 if (!config.enabled('instant-nodes')) | 25 if (!config.enabled('instant-nodes')) |
26 return makeError(response, errors.owner.create.instant_nodes_not_supported.n); | 26 return makeError(response, errors.owner.create.instant_nodes_not_supported.n); |
27 nodeID = utils.makeRandomId(); | 27 nodeID = fdsq.makeRandomId(); |
28 instant = true; | 28 instant = true; |
29 } | 29 } |
30 if (storage.existsNode(nodeID)) | 30 if (storage.existsNode(nodeID)) |
31 return makeError(response, errors.owner.create.nodeid_already_exists.n); | 31 return makeError(response, errors.owner.create.nodeid_already_exists.n); |
32 | 32 |