Mercurial > psgxs
comparison storage.js @ 50:e6c2c66c2002
Handle 'none' on set affiliation bug #2246
author | Sonny Piers <sonny.piers@gmail.com> |
---|---|
date | Mon, 21 Mar 2011 15:15:01 +0100 |
parents | c979c4d0932b |
children | 296de54c1c4b |
comparison
equal
deleted
inserted
replaced
49:7e421278b31b | 50:e6c2c66c2002 |
---|---|
376 node.publishOnly.push(jid); | 376 node.publishOnly.push(jid); |
377 else if (config.enabled('member-affiliation') && affil == 'member') | 377 else if (config.enabled('member-affiliation') && affil == 'member') |
378 node.member.push(jid); | 378 node.member.push(jid); |
379 else if (config.enabled('outcast-affiliation') && affil == 'outcast') | 379 else if (config.enabled('outcast-affiliation') && affil == 'outcast') |
380 node.outcast.push(jid); | 380 node.outcast.push(jid); |
381 else if (affil == 'none') { | |
382 (function() { | |
383 for (var i in node.outcast) | |
384 if(node.outcast[i] == jid) | |
385 return node.outcast.splice(i, 1); | |
386 for (var i in node.owner) | |
387 if(node.owner[i] == jid) | |
388 return node.owner.splice(i, 1); | |
389 for (var i in node.publisher) | |
390 if(node.publisher[i] == jid) | |
391 return node.publisher.splice(i, 1); | |
392 for (var i in node.publishOnly) | |
393 if(node.publishOnly[i] == jid) | |
394 return node.publishOnly.splice(i, 1); | |
395 for (var i in node.member) | |
396 if(node.member[i] == jid) | |
397 return node.member.splice(i, 1); | |
398 })() | |
399 } | |
381 | 400 |
382 storage.save(); | 401 storage.save(); |
383 return errors.success; | 402 return errors.success; |
384 }; | 403 }; |
385 | 404 |