Mercurial > psgxs
comparison storage.js @ 6:2bcadb0531f4
A few changes.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Mon, 23 Aug 2010 14:41:55 +0200 |
parents | d8a98540d749 |
children | a6429f48e403 |
comparison
equal
deleted
inserted
replaced
5:d8a98540d749 | 6:2bcadb0531f4 |
---|---|
134 }; | 134 }; |
135 | 135 |
136 storage.getNode = function(nodeID) { | 136 storage.getNode = function(nodeID) { |
137 if (list[nodeID]) | 137 if (list[nodeID]) |
138 return list[nodeID]; | 138 return list[nodeID]; |
139 return errors.sub.subscribe.node_does_not_exist.n; | 139 return errors.node_does_not_exist.n; |
140 }; | 140 }; |
141 | 141 |
142 storage.existsNode = function(nodeID) { | 142 storage.existsNode = function(nodeID) { |
143 if (list[nodeID]) | 143 if (list[nodeID]) |
144 return true; | 144 return true; |
402 return 'publisher'; | 402 return 'publisher'; |
403 if (config.enabled('publish-only-affiliation')) | 403 if (config.enabled('publish-only-affiliation')) |
404 for (var affil in node.publishOnly) | 404 for (var affil in node.publishOnly) |
405 if (typeof affil == 'string' && node.publishOnly[affil] == jid) | 405 if (typeof affil == 'string' && node.publishOnly[affil] == jid) |
406 return 'publish-only'; | 406 return 'publish-only'; |
407 if (config.enabled('member-affiliation')) | |
408 for (var affil in node.member) | |
409 if (typeof affil == 'string' && node.member[affil] == jid) | |
410 return 'member'; | |
407 if (config.enabled('outcast-affiliation')) | 411 if (config.enabled('outcast-affiliation')) |
408 for (var affil in node.outcast) | 412 for (var affil in node.outcast) |
409 if (typeof affil == 'string' && node.outcast[affil] == jid) | 413 if (typeof affil == 'string' && node.outcast[affil] == jid) |
410 return 'outcast'; | 414 return 'outcast'; |
411 return 'none'; | 415 return 'none'; |
435 for (var affil in node.publishOnly) | 439 for (var affil in node.publishOnly) |
436 if (typeof affil == 'string' && node.publishOnly[affil] == jid) { | 440 if (typeof affil == 'string' && node.publishOnly[affil] == jid) { |
437 affils[nodeID] = 'publish-only'; | 441 affils[nodeID] = 'publish-only'; |
438 break; | 442 break; |
439 } | 443 } |
444 if (config.enabled('member-affiliation')) | |
445 for (var affil in node.member) | |
446 if (typeof affil == 'string' && node.member[affil] == jid) { | |
447 affils[nodeID] = 'member'; | |
448 break; | |
449 } | |
440 if (config.enabled('outcast-affiliation')) | 450 if (config.enabled('outcast-affiliation')) |
441 for (var affil in node.outcast) | 451 for (var affil in node.outcast) |
442 if (typeof affil == 'string' && node.outcast[affil] == jid) { | 452 if (typeof affil == 'string' && node.outcast[affil] == jid) { |
443 affils[nodeID] = 'outcast'; | 453 affils[nodeID] = 'outcast'; |
444 break; | 454 break; |