aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2018-09-20 11:14:11 +0200
committerBadlop <badlop@process-one.net>2018-09-25 10:55:51 +0200
commit9bac2fa185bde1e059277c50ba66d08d70b7f974 (patch)
tree5ec4bf106eb6a7f767bb4506f1d7577f3312c90e /src
parentUpdate deps once more (diff)
Allow a subscribed owner/admin to change participant<->visitor
Diffstat (limited to 'src')
-rw-r--r--src/mod_muc_room.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl
index c4470968c..fec21d2f5 100644
--- a/src/mod_muc_room.erl
+++ b/src/mod_muc_room.erl
@@ -2862,8 +2862,13 @@ find_changed_items(UJID, UAffiliation, URole,
TAffiliation = get_affiliation(JID, StateData),
TRole = get_role(JID, StateData),
ServiceAf = get_service_affiliation(JID, StateData),
+ UIsSubscriber = is_subscriber(UJID, StateData),
+ URole1 = case {URole, UIsSubscriber} of
+ {none, true} -> subscriber;
+ {UR, _} -> UR
+ end,
CanChangeRA = case can_change_ra(UAffiliation,
- URole,
+ URole1,
TAffiliation,
TRole, RoleOrAff, RoleOrAffValue,
ServiceAf) of
@@ -2986,6 +2991,11 @@ can_change_ra(_FAffiliation, moderator, _TAffiliation,
can_change_ra(_FAffiliation, moderator, _TAffiliation,
visitor, role, participant, _ServiceAf) ->
true;
+can_change_ra(FAffiliation, subscriber, _TAffiliation,
+ visitor, role, participant, _ServiceAf)
+ when (FAffiliation == owner) or
+ (FAffiliation == admin) ->
+ true;
can_change_ra(FAffiliation, _FRole, _TAffiliation,
visitor, role, moderator, _ServiceAf)
when (FAffiliation == owner) or
@@ -2997,6 +3007,11 @@ can_change_ra(_FAffiliation, moderator, _TAffiliation,
can_change_ra(_FAffiliation, moderator, _TAffiliation,
participant, role, visitor, _ServiceAf) ->
true;
+can_change_ra(FAffiliation, subscriber, _TAffiliation,
+ participant, role, visitor, _ServiceAf)
+ when (FAffiliation == owner) or
+ (FAffiliation == admin) ->
+ true;
can_change_ra(FAffiliation, _FRole, _TAffiliation,
participant, role, moderator, _ServiceAf)
when (FAffiliation == owner) or