diff modules/mod_publish_message.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 99bd1d1ac071
line wrap: on
line diff
--- a/modules/mod_publish_message.js
+++ b/modules/mod_publish_message.js
@@ -26,7 +26,7 @@ exports.publishMessage = {
 		if (!config.enabled('publish'))
 			return makeError(response, errors.pub.publish.item_publication_not_supported.n);
 
-		var nodeID = fdsq.toResource(from);
+		var nodeID = JID.toResource(from);
 		if (!nodeID || nodeID == '')
 			return makeError(response, errors.nodeid_required.n);
 
@@ -38,7 +38,7 @@ exports.publishMessage = {
 				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')
@@ -46,7 +46,7 @@ exports.publishMessage = {
 
 		if (!config.enabled('item-ids'))
 			return makeError(response, errors.itemid_required.n);
-		var itemID = fdsq.makeRandomId();
+		var itemID = makeRandomId();
 
 		var now = new Date();
 
@@ -68,7 +68,7 @@ exports.publishMessage = {
 		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')