From e51776e84897d7929a8f2a0bc853e5c34f78b717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Oct=C3=A1vio=20Tarrafil?= Date: Mon, 24 Aug 2020 16:20:37 -0300 Subject: [PATCH 1/2] Update mod_muc_room.erl --- src/mod_muc_room.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 03faa6a0646..efc2bfc1692 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -3131,6 +3131,9 @@ can_change_ra(owner, _FRole, admin, _TRole, affiliation, can_change_ra(owner, _FRole, owner, _TRole, affiliation, _Affiliation, _ServiceAf) -> check_owner; +can_change_ra(member, participant, member, + participant, affiliation, none, none) -> + true; % Allow a member that joined the room to de-member himself can_change_ra(_FAffiliation, _FRole, _TAffiliation, _TRole, affiliation, _Value, _ServiceAf) -> false; From 0c2d252631e19877e2aa367e2044908510065d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Oct=C3=A1vio=20Tarrafil?= Date: Thu, 27 Aug 2020 17:42:46 -0300 Subject: [PATCH 2/2] Admin de-member himself --- src/mod_muc_room.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index efc2bfc1692..47055bb85f7 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -3131,6 +3131,9 @@ can_change_ra(owner, _FRole, admin, _TRole, affiliation, can_change_ra(owner, _FRole, owner, _TRole, affiliation, _Affiliation, _ServiceAf) -> check_owner; +can_change_ra(admin, _FRole, admin, + _TRole, affiliation, none, none) -> + true; % Allow a admin that joined the room to de-member himself can_change_ra(member, participant, member, participant, affiliation, none, none) -> true; % Allow a member that joined the room to de-member himself