diff modules/mod_manage.js @ 58:b98e545a94f7 default tip

Always use children instead of tags. Might break something.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 13 Sep 2011 00:54:55 +0200
parents c2c9c06d6e9d
children
line wrap: on
line diff
--- a/modules/mod_manage.js
+++ b/modules/mod_manage.js
@@ -103,8 +103,8 @@ exports.modifySub = {
 
 		var e = false;
 		var tags2 = [];
-		for (i in request.tags) {
-			var tag = request.tags[i];
+		for (i in request.children) {
+			var tag = request.children[i];
 			var jid = tag.getAttribute('jid');
 			var sub = tag.getAttribute('subscription');
 
@@ -124,7 +124,7 @@ exports.modifySub = {
 			}
 		}
 
-		request.tags = tags2;
+		request.children = tags2;
 
 		if (e)
 			return makeError(response, errors.owner.manage_subscriptions.modify.multiple_simultaneous_modifications.n, pubsub);
@@ -154,9 +154,9 @@ exports.modifyAff = {
 			return makeError(response, errors.forbidden.n);
 
 		var e = false;
-		for (var i in request.tags) {
-			var jid = request.tags[i].getAttribute('jid');
-			var affiliation = request.tags[i].getAttribute('affiliation');
+		for (var i in request.children) {
+			var jid = request.children[i].getAttribute('jid');
+			var affiliation = request.children[i].getAttribute('affiliation');
 
 			var set = storage.setAffiliation(nodeID, jid, affiliation);
 			if (typeof set == 'number')
@@ -164,7 +164,7 @@ exports.modifyAff = {
 			else {
 				// SECTION 8.9.4
 				notifs.send(jid, 'affiliations', nodeID, {jid: jid, affiliation: affiliation});
-				request.tags.splice(i, 1);
+				request.children.splice(i, 1);
 			}
 		}