comparison modules/mod_retrieve.js @ 47:0d3f18bb1d36

Remove usage of fdsq.js in modules.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 10 Mar 2011 16:13:49 +0100
parents 023f767662d3
children c2c9c06d6e9d
comparison
equal deleted inserted replaced
46:3126f8d6a5e3 47:0d3f18bb1d36
31 31
32 var nodeID = request.getAttribute('node'); 32 var nodeID = request.getAttribute('node');
33 if (nodeID && nodeID != '') { 33 if (nodeID && nodeID != '') {
34 if (!storage.existsNode(nodeID)) 34 if (!storage.existsNode(nodeID))
35 return makeError(response, errors.node_does_not_exist.n); 35 return makeError(response, errors.node_does_not_exist.n);
36 var subs = storage.getSubscription(toBareJID(to), nodeID); 36 var subs = storage.getSubscription(JID.toBare(to), nodeID);
37 } else 37 } else
38 var subs = storage.getSubscription(toBareJID(to)); 38 var subs = storage.getSubscription(JID.toBare(to));
39 39
40 response.c('pubsub', {xmlns: NS.PUBSUB}) 40 response.c('pubsub', {xmlns: NS.PUBSUB})
41 .c('subscriptions'); 41 .c('subscriptions');
42 42
43 for (i in subs) 43 for (i in subs)
60 var nodeID = request.getAttribute('node'); 60 var nodeID = request.getAttribute('node');
61 if (nodeID && nodeID != '') { 61 if (nodeID && nodeID != '') {
62 if (!storage.existsNode(nodeID)) 62 if (!storage.existsNode(nodeID))
63 return makeError(response, errors.node_does_not_exist.n); 63 return makeError(response, errors.node_does_not_exist.n);
64 var affils = {}; 64 var affils = {};
65 affils[nodeID] = storage.getAffiliation(toBareJID(to), nodeID); 65 affils[nodeID] = storage.getAffiliation(JID.toBare(to), nodeID);
66 } else 66 } else
67 var affils = storage.getAffiliationsFromJID(toBareJID(to)); 67 var affils = storage.getAffiliationsFromJID(JID.toBare(to));
68 68
69 response.c('pubsub', {xmlns: NS.PUBSUB}) 69 response.c('pubsub', {xmlns: NS.PUBSUB})
70 .c('affiliations'); 70 .c('affiliations');
71 71
72 for (i in affils) 72 for (i in affils)
92 if (!storage.existsNode(nodeID)) 92 if (!storage.existsNode(nodeID))
93 return makeError(response, errors.node_does_not_exist.n); 93 return makeError(response, errors.node_does_not_exist.n);
94 94
95 var configuration = storage.getConfiguration(nodeID); 95 var configuration = storage.getConfiguration(nodeID);
96 if (configuration['pubsub#access_model'] == 'whitelist') { 96 if (configuration['pubsub#access_model'] == 'whitelist') {
97 var affil = storage.getAffiliation(toBareJID(to), nodeID); 97 var affil = storage.getAffiliation(JID.toBare(to), nodeID);
98 if (affil != 'super-owner' && affil != 'owner' && affil != 'publisher' && affil != 'member') 98 if (affil != 'super-owner' && affil != 'owner' && affil != 'publisher' && affil != 'member')
99 return makeError(response, errors.pub.publish.insufficient_privileges.n); 99 return makeError(response, errors.pub.publish.insufficient_privileges.n);
100 } 100 }
101 101
102 var item = []; 102 var item = [];