Mercurial > psgxs
comparison modules/mod_options.js @ 41:bc717575e66a
Much better handling of modules.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 20 Feb 2011 15:51:12 +0100 |
parents | 6697f394301f |
children | 023f767662d3 |
comparison
equal
deleted
inserted
replaced
40:741110cdcfcf | 41:bc717575e66a |
---|---|
1 var config = require('../configuration'); | |
2 var storage = require('../storage'); | |
3 var forms = require('../forms'); | |
4 var errors = require('../errors'); | |
5 var makeError = errors.makeError; | |
6 var toBareJID = require('../fdsq').toBareJID; | |
7 var NS = require('../namespaces'); | |
8 | |
9 // SECTION 6.3.2: Configure Subscription Options (Request) | 1 // SECTION 6.3.2: Configure Subscription Options (Request) |
10 exports.getConfigureSub = { | 2 exports.getConfigureSub = { |
11 type: 'get', | 3 type: 'get', |
12 child: 'pubsub', | 4 child: 'pubsub', |
13 ns: NS.PUBSUB, | 5 ns: NS.PUBSUB, |
30 | 22 |
31 var subs = storage.getSubscription(jid, nodeID); | 23 var subs = storage.getSubscription(jid, nodeID); |
32 if (!subs.subid) // FIXME: better test for empty object. | 24 if (!subs.subid) // FIXME: better test for empty object. |
33 return makeError(response, errors.sub.configure.no_such_subscriber.n); | 25 return makeError(response, errors.sub.configure.no_such_subscriber.n); |
34 | 26 |
35 response.c('pubsub', {xmlns: NS.PUBSUB}); | 27 response.c('pubsub', {xmlns: NS.PUBSUB}) |
36 response.c('options', {node: nodeID, jid: jid}); | 28 .c('options', {node: nodeID, jid: jid}); |
37 | 29 |
38 var form = forms.build('form', 'subscribe_options', subs.options, true); | 30 var form = forms.build('form', 'subscribe_options', subs.options, true); |
39 response.cnode(form); | 31 response.cnode(form); |
40 | 32 |
41 return response; | 33 return response; |