diff modules/mod_publish.js @ 47:0d3f18bb1d36

Remove usage of fdsq.js in modules.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 10 Mar 2011 16:13:49 +0100
parents 023f767662d3
children c979c4d0932b
line wrap: on
line diff
--- a/modules/mod_publish.js
+++ b/modules/mod_publish.js
@@ -41,7 +41,7 @@ exports.publish = {
 				return makeError(response, errors.node_does_not_exist.n);
 		}
 
-		var affil = storage.getAffiliation(toBareJID(to), nodeID);
+		var affil = storage.getAffiliation(JID.toBare(to), nodeID);
 		if (typeof affil == 'number' && affil != errors.node_does_not_exist.n)
 			return makeError(response, affil);
 		if (!autocreate && affil != 'super-owner' && affil != 'owner' && affil != 'publisher' && affil != 'publish-only')
@@ -51,7 +51,7 @@ exports.publish = {
 		var itemID = item.getAttribute('id');
 		if (!config.enabled('item-ids') && itemID)
 			return makeError(response, errors.itemid_required.n);
-		itemID = itemID? itemID: fdsq.makeRandomId();
+		itemID = itemID? itemID: makeRandomId();
 
 		if (item.tags.length != 1)
 			return makeError(response, errors.pub.publish.bad_payload.n);
@@ -77,7 +77,7 @@ exports.publish = {
 		if (autocreate) {
 			if (!form)
 				form = {};
-			form['pubsub#creator'] = toBareJID(to);
+			form['pubsub#creator'] = JID.toBare(to);
 
 			var r = storage.createNode(nodeID, form);
 			if (typeof r == 'number')
@@ -129,7 +129,7 @@ exports.retract = {
 		if (!itemID || itemID == '')
 			return makeError(response, errors.pub.retract.item_or_itemid_required.n);
 
-		var affil = storage.getAffiliation(toBareJID(to), nodeID);
+		var affil = storage.getAffiliation(JID.toBare(to), nodeID);
 		if (affil != 'super-owner' && affil != 'owner' && affil != 'publish-only')
 			return makeError(response, errors.forbidden.n);