|
@@ -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
|