#769 MUC owners cannot kick other owners

Reporter Sam Whited
Owner MattJ
Stars ★★ (3)
  • Status-Fixed
  • Type-Defect
  • Patch
  • Priority-Medium
  • Milestone-0.12
  • Compliance
  1. Sam Whited on

    Although the spec is somewhat unclear on it, I think the intention is that owners should be other to kick other owners (and admins should be able to kick other admins) from a MUC. Currently, this is not possible. This was discussed in the chat, and I beleive the following patch fixes the issue: https://q.zash.se/ba0f950ae243.txt

  2. Zash on

    Copying patch here so it is not lost to the pastebins garbage collection. diff -r 5022e6181193 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Tue Oct 18 19:07:55 2016 +0200 +++ b/plugins/muc/muc.lib.lua Mon Oct 24 15:49:46 2016 -0500 @@ -1256,15 +1256,16 @@ if actor == true then actor = nil -- So we can pass it safely to 'publicise_occupant_status' below else - -- Can't do anything to other owners or admins + local actor_affiliation = self:get_affiliation(actor); + + -- Can't do anything to other owners or admins unless you are one local occupant_affiliation = self:get_affiliation(occupant.bare_jid); - if occupant_affiliation == "owner" or occupant_affiliation == "admin" then + if (occupant_affiliation == "owner" and actor_affiliation ~= "owner") or (occupant_affiliation == "admin" and actor_affiliation ~= "admin" and actor_affiliation ~= "owner") then return nil, "cancel", "not-allowed"; end -- If you are trying to give or take moderator role you need to be an owner or admin if occupant.role == "moderator" or role == "moderator" then - local actor_affiliation = self:get_affiliation(actor); if actor_affiliation ~= "owner" and actor_affiliation ~= "admin" then return nil, "cancel", "not-allowed"; end

  3. Zash on

    Proper specification reference and test case would be good to move this forward.

    • tags Patch
  4. MattJ on

    Fixed in 0.12 by https://hg.prosody.im/trunk/rev/3dfcdcab5446 (a duplicate issue, #1724, was created)

    • owner MattJ
    • tags Milestone-0.12 Status-Fixed

New comment

Not published. Used for spam prevention and optional update notifications.