plugins/muc/muc.lib.lua

changeset 2984
3094166cfdd5
parent 2978
5760074dc7d4
parent 2979
b1726c2a2afc
child 2985
fde53d82fde0
--- a/plugins/muc/muc.lib.lua	Mon Apr 19 18:30:59 2010 +0500
+++ b/plugins/muc/muc.lib.lua	Sat May 01 05:18:38 2010 +0500
@@ -751,7 +751,7 @@
 function room_mt:set_role(actor, occupant_jid, role, callback, reason)
 	if role == "none" then role = nil; end
 	if role and role ~= "moderator" and role ~= "participant" and role ~= "visitor" then return nil, "modify", "not-acceptable"; end
-	if self:get_affiliation(actor) ~= "owner" then return nil, "cancel", "not-allowed"; end
+	if self:get_role(self._jid_nick[actor]) ~= "moderator" then return nil, "cancel", "not-allowed"; end
 	local occupant = self._occupants[occupant_jid];
 	if not occupant then return nil, "modify", "not-acceptable"; end
 	if occupant.affiliation == "owner" or occupant.affiliation == "admin" then return nil, "cancel", "not-allowed"; end

mercurial