Mercurial > psgxs
comparison modules/mod_subscribe.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 | addbf6bbfaa8 |
comparison
equal
deleted
inserted
replaced
46:3126f8d6a5e3 | 47:0d3f18bb1d36 |
---|---|
37 | 37 |
38 var configuration = storage.getConfiguration(nodeID); | 38 var configuration = storage.getConfiguration(nodeID); |
39 if (!configuration['pubsub#subscribe']) | 39 if (!configuration['pubsub#subscribe']) |
40 return makeError(response, errors.sub.subscribe.not_supported.n); | 40 return makeError(response, errors.sub.subscribe.not_supported.n); |
41 | 41 |
42 var affil = storage.getAffiliation(toBareJID(to), nodeID); | 42 var affil = storage.getAffiliation(JID.toBare(to), nodeID); |
43 if (affil == 'publish-only' || affil == 'outcast') | 43 if (affil == 'publish-only' || affil == 'outcast') |
44 return makeError(response, errors.pub.publish.insufficient_privileges.n); | 44 return makeError(response, errors.pub.publish.insufficient_privileges.n); |
45 | 45 |
46 var jid = request.getAttribute('jid'); | 46 var jid = request.getAttribute('jid'); |
47 if (!jid || toBareJID(jid) != toBareJID(to)) | 47 if (!jid || JID.toBare(jid) != JID.toBare(to)) |
48 return makeError(response, errors.sub.subscribe.jids_do_not_match.n); | 48 return makeError(response, errors.sub.subscribe.jids_do_not_match.n); |
49 | 49 |
50 /* | 50 /* |
51 // SECTION 6.3.7 | 51 // SECTION 6.3.7 |
52 var options = pubsub.getChild('options'); | 52 var options = pubsub.getChild('options'); |
128 return makeError(response, errors.nodeid_required.n); | 128 return makeError(response, errors.nodeid_required.n); |
129 if (!storage.existsNode(nodeID)) | 129 if (!storage.existsNode(nodeID)) |
130 return makeError(response, errors.node_does_not_exist.n); | 130 return makeError(response, errors.node_does_not_exist.n); |
131 | 131 |
132 var jid = request.getAttribute('jid'); | 132 var jid = request.getAttribute('jid'); |
133 if (!jid || toBareJID(jid) != toBareJID(to)) | 133 if (!jid || JID.toBare(jid) != JID.toBare(to)) |
134 return makeError(response, errors.sub.unsubscribe.insufficient_privileges.n); | 134 return makeError(response, errors.sub.unsubscribe.insufficient_privileges.n); |
135 | 135 |
136 var subID = storage.subscribe(nodeID, jid, 'none'); | 136 var subID = storage.subscribe(nodeID, jid, 'none'); |
137 if (typeof subID == 'number') | 137 if (typeof subID == 'number') |
138 return makeError(response, subID); | 138 return makeError(response, subID); |