comparison psgxs.js @ 19:032090a13fe8

Can’t send subscription-options to non-subscribed people.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 19 Oct 2010 18:53:54 +0200
parents 75625771e410
children 957550e2d5a1
comparison
equal deleted inserted replaced
18:75625771e410 19:032090a13fe8
247 return makeError(response, errors.sub.configure.subscriber_jid_required.n); 247 return makeError(response, errors.sub.configure.subscriber_jid_required.n);
248 if (toBareJID(jid) != toBareJID(to)) 248 if (toBareJID(jid) != toBareJID(to))
249 return makeError(response, errors.sub.configure.insufficient_privileges.n); 249 return makeError(response, errors.sub.configure.insufficient_privileges.n);
250 250
251 var subs = storage.getSubscription(jid, nodeID); 251 var subs = storage.getSubscription(jid, nodeID);
252 if (subs == {}) 252 if (!subs.subid) // FIXME: better test for empty object.
253 return makeError(response, errors.sub.configure.no_such_subscriber.n); 253 return makeError(response, errors.sub.configure.no_such_subscriber.n);
254 254
255 var s = xmpp.stanza('options', {node: nodeID, jid: jid}); 255 var s = xmpp.stanza('options', {node: nodeID, jid: jid});
256 var p = xmpp.stanza('pubsub', {xmlns: 'http://jabber.org/protocol/pubsub'}); 256 var p = xmpp.stanza('pubsub', {xmlns: 'http://jabber.org/protocol/pubsub'});
257 var form = forms.build('form', 'subscribe_options', subs.options, true); 257 var form = forms.build('form', 'subscribe_options', subs.options, true);