Mercurial > psgxs
diff 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 |
line wrap: on
line diff
--- a/storage.js +++ b/storage.js @@ -136,7 +136,7 @@ storage.getChildren = function(node) { storage.getNode = function(nodeID) { if (list[nodeID]) return list[nodeID]; - return errors.sub.subscribe.node_does_not_exist.n; + return errors.node_does_not_exist.n; }; storage.existsNode = function(nodeID) { @@ -404,6 +404,10 @@ storage.getAffiliation = function(jid, n for (var affil in node.publishOnly) if (typeof affil == 'string' && node.publishOnly[affil] == jid) return 'publish-only'; + if (config.enabled('member-affiliation')) + for (var affil in node.member) + if (typeof affil == 'string' && node.member[affil] == jid) + return 'member'; if (config.enabled('outcast-affiliation')) for (var affil in node.outcast) if (typeof affil == 'string' && node.outcast[affil] == jid) @@ -437,6 +441,12 @@ storage.getAffiliationsFromJID = functio affils[nodeID] = 'publish-only'; break; } + if (config.enabled('member-affiliation')) + for (var affil in node.member) + if (typeof affil == 'string' && node.member[affil] == jid) { + affils[nodeID] = 'member'; + break; + } if (config.enabled('outcast-affiliation')) for (var affil in node.outcast) if (typeof affil == 'string' && node.outcast[affil] == jid) {