mod_privacy: Return the correct item-not-found instead of bad-request when a non-existent list is activated by the client (thanks teo)

Fri, 02 Jul 2010 19:55:08 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 02 Jul 2010 19:55:08 +0100
changeset 3313
9bcf8d612a52
parent 3311
88cfe1bba690
child 3314
4019ad5c61e2
child 3317
82b17b199d68

mod_privacy: Return the correct item-not-found instead of bad-request when a non-existent list is activated by the client (thanks teo)

plugins/mod_privacy.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_privacy.lua	Fri Jul 02 17:24:40 2010 +0100
+++ b/plugins/mod_privacy.lua	Fri Jul 02 19:55:08 2010 +0100
@@ -93,8 +93,10 @@
 	elseif which == "active" and list then
 		origin.activePrivacyList = name;
 		origin.send(st.reply(stanza));
+	elseif not list then
+		return {"cancel", "item-not-found", "No such list: "..name};
 	else
-		return {"modify", "bad-request", "Either not active or default given or unknown list name specified."};
+		return {"modify", "bad-request", "No list chosen to be active or default."};
 	end
 	return true;
 end

mercurial