Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

muc_owner_allow_kick.patch 1.0KB

123456789101112131415161718192021
  1. --- muc.lib.lua 2016-10-26 18:26:53.432377291 +0000
  2. +++ muc.lib.lua 2016-10-26 18:41:40.754426072 +0000
  3. @@ -1256,15 +1256,16 @@
  4. if actor == true then
  5. actor = nil -- So we can pass it safely to 'publicise_occupant_status' below
  6. else
  7. + local actor_affiliation = self:get_affiliation(actor);
  8. +
  9. -- Can't do anything to other owners or admins
  10. local occupant_affiliation = self:get_affiliation(occupant.bare_jid);
  11. - if occupant_affiliation == "owner" or occupant_affiliation == "admin" then
  12. + if (occupant_affiliation == "owner" and actor_affiliation ~= "owner") or (occupant_affiliation == "admin" and actor_affiliation ~= "admin" and actor_affiliation ~= "owner") then
  13. return nil, "cancel", "not-allowed";
  14. end
  15. -- If you are trying to give or take moderator role you need to be an owner or admin
  16. if occupant.role == "moderator" or role == "moderator" then
  17. - local actor_affiliation = self:get_affiliation(actor);
  18. if actor_affiliation ~= "owner" and actor_affiliation ~= "admin" then
  19. return nil, "cancel", "not-allowed";
  20. end