Mercurial > psgxs
comparison notifs.js @ 53:ca17b63f561f
Fix auto-subscribe of owner.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 07 Apr 2011 17:12:07 +0200 |
parents | 023f767662d3 |
children | fd69d35cf2e6 |
comparison
equal
deleted
inserted
replaced
52:296de54c1c4b | 53:ca17b63f561f |
---|---|
43 return; | 43 return; |
44 } | 44 } |
45 | 45 |
46 var configuration = xmpp.stanza('configuration', {node: nodeID}); | 46 var configuration = xmpp.stanza('configuration', {node: nodeID}); |
47 if (a1) { | 47 if (a1) { |
48 var x = forms.build('node_config', service_configuration.node_config, storage.getConfiguration(nodeID)); | 48 var x = forms.build('node_config', config.service_configuration.node_config, storage.getConfiguration(nodeID)); |
49 if (x) | 49 if (x) |
50 configuration.cnode(x); //TODO: voir exemple 150 | 50 configuration.cnode(x); //TODO: voir exemple 150 |
51 } | 51 } |
52 ev.cnode(configuration); | 52 ev.cnode(configuration); |
53 } else if (type == 'delete') { | 53 } else if (type == 'delete') { |
114 subs = {}; | 114 subs = {}; |
115 subs[notifs] = storage.getSubscription(notifs, nodeID); | 115 subs[notifs] = storage.getSubscription(notifs, nodeID); |
116 } else | 116 } else |
117 subs = notifs; | 117 subs = notifs; |
118 | 118 |
119 var affils = storage.getAffiliationsFromNodeID(nodeID); | |
120 for (var i in affils) | |
121 if (!(i in subs) || affils[i] == 'owner') | |
122 subs[i] = new config.Configuration(config.service_configuration.subscribe_options); | |
123 | |
119 for (var i in subs) { | 124 for (var i in subs) { |
120 var sub = subs[i]; | 125 var sub = subs[i]; |
121 | 126 |
122 if (sub.options) { | 127 if (sub.options) { |
123 if (typeof sub.options['pubsub#deliver'] != 'undefined' && !sub.options['pubsub#deliver']) | 128 if (typeof sub.options['pubsub#deliver'] != 'undefined' && !sub.options['pubsub#deliver']) |