comparison modules/mod_options.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
comparison
equal deleted inserted replaced
46:3126f8d6a5e3 47:0d3f18bb1d36
36 return makeError(response, errors.node_does_not_exist.n); 36 return makeError(response, errors.node_does_not_exist.n);
37 37
38 var jid = request.getAttribute('jid'); 38 var jid = request.getAttribute('jid');
39 if (!jid) 39 if (!jid)
40 return makeError(response, errors.sub.configure.subscriber_jid_required.n); 40 return makeError(response, errors.sub.configure.subscriber_jid_required.n);
41 if (toBareJID(jid) != toBareJID(to)) 41 if (JID.toBare(jid) != JID.toBare(to))
42 return makeError(response, errors.sub.configure.insufficient_privileges.n); 42 return makeError(response, errors.sub.configure.insufficient_privileges.n);
43 43
44 var subs = storage.getSubscription(jid, nodeID); 44 var subs = storage.getSubscription(jid, nodeID);
45 if (!subs.subid) // FIXME: better test for empty object. 45 if (!subs.subid) // FIXME: better test for empty object.
46 return makeError(response, errors.sub.configure.no_such_subscriber.n); 46 return makeError(response, errors.sub.configure.no_such_subscriber.n);
70 return makeError(response, errors.nodeid_required.n); 70 return makeError(response, errors.nodeid_required.n);
71 if (!storage.existsNode(nodeID)) 71 if (!storage.existsNode(nodeID))
72 return makeError(response, errors.node_does_not_exist.n); 72 return makeError(response, errors.node_does_not_exist.n);
73 73
74 var jid = unsubscribe.getAttribute('jid'); 74 var jid = unsubscribe.getAttribute('jid');
75 if (!jid || toBareJID(jid) != toBareJID(to)) 75 if (!jid || JID.toBare(jid) != JID.toBare(to))
76 return makeError(response, errors.sub.unsubscribe.insufficient_privileges.n); 76 return makeError(response, errors.sub.unsubscribe.insufficient_privileges.n);
77 77
78 var x = request.getChild('x', 'jabber:x:data'); 78 var x = request.getChild('x', 'jabber:x:data');
79 if (!x || x.getAttribute(type) != 'submit') 79 if (!x || x.getAttribute(type) != 'submit')
80 return makeError(response, errors.bad_request); 80 return makeError(response, errors.bad_request);