comparison modules/mod_subscribe.js @ 39:4c808bfe0658

Various little fixes.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 15 Dec 2010 22:22:14 +0100
parents 6697f394301f
children bc717575e66a
comparison
equal deleted inserted replaced
38:5395a501c991 39:4c808bfe0658
1 var config = require('../configuration'); 1 var config = require('../configuration');
2 var storage = require('../storage'); 2 var storage = require('../storage');
3 var errors = require('../errors'); 3 var errors = require('../errors');
4 var notifs = require('../notifs');
4 var makeError = errors.makeError; 5 var makeError = errors.makeError;
5 var toBareJID = require('../fdsq').toBareJID; 6 var toBareJID = require('../fdsq').toBareJID;
6 var NS = require('../namespaces'); 7 var NS = require('../namespaces');
7 8
8 // SECTION 6.1: Subscribe to a Node 9 // SECTION 6.1: Subscribe to a Node
103 exports.unsubscribe = { 104 exports.unsubscribe = {
104 type: 'set', 105 type: 'set',
105 child: 'pubsub', 106 child: 'pubsub',
106 ns: NS.PUBSUB, 107 ns: NS.PUBSUB,
107 child2: 'unsubscribe', 108 child2: 'unsubscribe',
108 func: function(response, stanza, request) { 109 func: function(response, stanza, request, to) {
109 if (!config.enabled('subscribe')) 110 if (!config.enabled('subscribe'))
110 return makeError(response, errors.sub.subscribe.not_supported.n); 111 return makeError(response, errors.sub.subscribe.not_supported.n);
111 112
112 var nodeID = request.getAttribute('node'); 113 var nodeID = request.getAttribute('node');
113 if (!nodeID || nodeID == '') 114 if (!nodeID || nodeID == '')