From: Waqas Hussain Date: Mon, 7 Sep 2009 15:31:35 +0000 (+0500) Subject: MUC: An admin or owner MUST NOT be able to revoke moderation privileges from another... X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=81ac4d62f55cc3bd9b5bc21fa6a67995fb5913e4;p=prosody.git MUC: An admin or owner MUST NOT be able to revoke moderation privileges from another admin or owner. --- diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 1a4bbc16..7133d133 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -454,7 +454,7 @@ function room_mt:set_role(actor, nick, role, callback) if self:get_affiliation(actor) ~= "owner" then return nil, "cancel", "not-allowed"; end local occupant = self._occupants[nick]; if not occupant then return nil, "modify", "not-acceptable"; end - if jid_bare(actor) == occupant.jid then return nil, "cancel", "not-allowed"; end + if occupant.affiliation == "owner" or occupant.affiliation == "admin" then return nil, "cancel", "not-allowed"; end local p = st.presence({from = nick, type = "unavailable"}) :tag("x", {xmlns = "http://jabber.org/protocol/muc#user"}) :tag("item", {affiliation=occupant.affiliation, nick=nick, role=role or "none"}):up();