Sfoglia il codice sorgente

feature: patch for muc_owner_allow_kick in prosody 0.12 (#11142)

master
Aaron van Meerten 3 anni fa
parent
commit
fbe15aaa47
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 22 aggiunte e 0 eliminazioni
  1. 22
    0
      resources/prosody-plugins/muc_owner_allow_kick-0.12.patch

+ 22
- 0
resources/prosody-plugins/muc_owner_allow_kick-0.12.patch Vedi File

@@ -0,0 +1,22 @@
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
+@@ -1582,16 +1582,16 @@
4
+ 	if event.allowed ~= nil then
5
+ 		return event.allowed, event.error, event.condition;
6
+ 	end
7
++	local occupant_affiliation = self:get_affiliation(occupant.bare_jid);
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
++	local actor_affiliation = self:get_affiliation(actor);
13
++	if (occupant_affiliation == "owner" and actor_affiliation ~= "owner") or (occupant_affiliation == "admin" and actor_affiliation ~= "admin" and actor_affiliation ~= "owner") then
14
+ 		return nil, "cancel", "not-allowed";
15
+ 	end
16
+ 
17
+ 	-- If you are trying to give or take moderator role you need to be an owner or admin
18
+ 	if occupant.role == "moderator" or role == "moderator" then
19
+-		local actor_affiliation = self:get_affiliation(actor);
20
+ 		if actor_affiliation ~= "owner" and actor_affiliation ~= "admin" then
21
+ 			return nil, "cancel", "not-allowed";
22
+ 		end

Loading…
Annulla
Salva