comparison modules/mod_manage.js @ 54:c2c9c06d6e9d

Fix problems with unneeded text nodes.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 06 May 2011 17:51:15 +0200
parents c979c4d0932b
children b98e545a94f7
comparison
equal deleted inserted replaced
53:ca17b63f561f 54:c2c9c06d6e9d
152 var affil = storage.getAffiliation(JID.toBare(to), nodeID); 152 var affil = storage.getAffiliation(JID.toBare(to), nodeID);
153 if (affil != 'super-owner' && affil != 'owner') 153 if (affil != 'super-owner' && affil != 'owner')
154 return makeError(response, errors.forbidden.n); 154 return makeError(response, errors.forbidden.n);
155 155
156 var e = false; 156 var e = false;
157 for (var i in request.children) { 157 for (var i in request.tags) {
158 var jid = request.children[i].getAttribute('jid'); 158 var jid = request.tags[i].getAttribute('jid');
159 var affiliation = request.children[i].getAttribute('affiliation'); 159 var affiliation = request.tags[i].getAttribute('affiliation');
160 160
161 var set = storage.setAffiliation(nodeID, jid, affiliation); 161 var set = storage.setAffiliation(nodeID, jid, affiliation);
162 if (typeof set == 'number') 162 if (typeof set == 'number')
163 e = true; 163 e = true;
164 else { 164 else {
165 // SECTION 8.9.4 165 // SECTION 8.9.4
166 notifs.send(jid, 'affiliations', nodeID, {jid: jid, affiliation: affiliation}); 166 notifs.send(jid, 'affiliations', nodeID, {jid: jid, affiliation: affiliation});
167 request.children.splice(i, 1); 167 request.tags.splice(i, 1);
168 } 168 }
169 } 169 }
170 170
171 if (e) 171 if (e)
172 return makeError(response, errors.owner.manage_affiliations.modify.multiple_simultaneous_modifications.n, pubsub); 172 return makeError(response, errors.owner.manage_affiliations.modify.multiple_simultaneous_modifications.n, pubsub);