MUC: Fix affiliation check for admins, and bring it in line with the spec (thanks Maranda).
authorWaqas Hussain <waqas20@gmail.com>
Tue, 26 Feb 2013 20:31:41 +0500
changeset 5334 da7857891eb8
parent 5333 760c345dc7a1
child 5335 bb81c13d2c6f
MUC: Fix affiliation check for admins, and bring it in line with the spec (thanks Maranda).
plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Tue Feb 26 19:41:52 2013 +0500
+++ b/plugins/muc/muc.lib.lua	Tue Feb 26 20:31:41 2013 +0500
@@ -987,7 +987,7 @@
 			return true;
 		end
 		if actor_affiliation ~= "owner" then
-			if actor_affiliation ~= "admin" or target_affiliation == "owner" or target_affiliation == "admin" then
+			if affiliation == "owner" or affiliation == "admin" or actor_affiliation ~= "admin" or target_affiliation == "owner" or target_affiliation == "admin" then
 				return nil, "cancel", "not-allowed";
 			end
 		elseif target_affiliation == "owner" and jid_bare(actor) == jid then -- self change