comparison storage.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 c979c4d0932b
comparison
equal deleted inserted replaced
46:3126f8d6a5e3 47:0d3f18bb1d36
25 var errors = require('./errors'); 25 var errors = require('./errors');
26 var config = require('./configuration'); 26 var config = require('./configuration');
27 var service_configuration = config.service_configuration; 27 var service_configuration = config.service_configuration;
28 var Configuration = config.Configuration; 28 var Configuration = config.Configuration;
29 var fdsq = require('./fdsq'); 29 var fdsq = require('./fdsq');
30 var toBareJID = fdsq.toBareJID; 30 var toBare = fdsq.toBare;
31 31
32 var nodes = require('./nodes'); 32 var nodes = require('./nodes');
33 var Node = nodes.Node; 33 var Node = nodes.Node;
34 var Item = nodes.Item; 34 var Item = nodes.Item;
35 35
306 storage.getSubscription = function(jid, nodeID) { 306 storage.getSubscription = function(jid, nodeID) {
307 var subs = {}; 307 var subs = {};
308 if (nodeID) { 308 if (nodeID) {
309 var node = storage.getNode(nodeID); 309 var node = storage.getNode(nodeID);
310 for (var sub in node.subscribers) 310 for (var sub in node.subscribers)
311 if (toBareJID(sub) == jid) 311 if (toBare(sub) == jid)
312 return node.subscribers[sub] 312 return node.subscribers[sub]
313 } else { 313 } else {
314 for (var node in backend.list) { 314 for (var node in backend.list) {
315 for (var sub in backend.list[node].subscribers) { 315 for (var sub in backend.list[node].subscribers) {
316 if (toBareJID(sub) == jid) 316 if (toBare(sub) == jid)
317 subs[node] = backend.list[node].subscribers[sub]; 317 subs[node] = backend.list[node].subscribers[sub];
318 } 318 }
319 } 319 }
320 } 320 }
321 return subs; 321 return subs;