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
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
Zash
on
Proper specification reference and test case would be good to move this forward.
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
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
Proper specification reference and test case would be good to move this forward.
ChangesFixed in 0.12 by https://hg.prosody.im/trunk/rev/3dfcdcab5446 (a duplicate issue, #1724, was created)
Changes