mod_pubsub: Use pubsub_error_reply everywhere

Fri, 03 Dec 2010 16:36:13 +0100

author
Florian Zeitz <florob@babelmonkeys.de>
date
Fri, 03 Dec 2010 16:36:13 +0100
changeset 3697
67c01f75af97
parent 3696
a96f275c42b5
child 3698
77171fd1dc3c

mod_pubsub: Use pubsub_error_reply everywhere

plugins/mod_pubsub.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_pubsub.lua	Fri Dec 03 01:03:52 2010 +0500
+++ b/plugins/mod_pubsub.lua	Fri Dec 03 16:36:13 2010 +0100
@@ -25,6 +25,7 @@
 end
 
 local pubsub_errors = {
+	["conflict"] = { "cancel", "conflict" };
 	["invalid-jid"] = { "modify", "bad-request", nil, "invalid-jid" };
 	["item-not-found"] = { "cancel", "item-not-found" };
 };
@@ -50,7 +51,7 @@
 			:tag("pubsub", { xmlns = xmlns_pubsub })
 				:add_child(data);
 	else
-		reply = st.error_reply(stanza, "cancel", "item-not-found", "Item could not be found in this node");
+		reply = pubsub_error_reply(stanza, "item-not-found");
 	end
 	return origin.send(reply);
 end
@@ -63,7 +64,7 @@
 		if ok then
 			reply = st.reply(stanza);
 		else
-			reply = st.error_reply(stanza, "cancel", ret);
+			reply = pubsub_error_reply(stanza, ret);
 		end
 	else
 		repeat

mercurial