Skip to content

Commit

Permalink
Expand rule "mucsub subscribers are members in members only rooms" to…
Browse files Browse the repository at this point in the history
… more places
  • Loading branch information
prefiks committed May 24, 2023
1 parent 1818a29 commit 4a53d4c
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/mod_muc_room.erl
Expand Up @@ -1695,13 +1695,23 @@ set_affiliations_fallback(Affiliations, StateData) ->
-spec get_affiliation(ljid() | jid(), state()) -> affiliation().
get_affiliation(#jid{} = JID, StateData) ->
case get_service_affiliation(JID, StateData) of
owner ->
owner;
none ->
case do_get_affiliation(JID, StateData) of
{Affiliation, _Reason} -> Affiliation;
Affiliation -> Affiliation
end
owner ->
owner;
none ->
Aff = case do_get_affiliation(JID, StateData) of
{Affiliation, _Reason} -> Affiliation;
Affiliation -> Affiliation
end,
case {Aff, (StateData#state.config)#config.members_only} of
% Subscribers should be have members affiliation in this case
{none, true} ->
case is_subscriber(JID, StateData) of
true -> member;
_ -> none
end;
_ ->
Aff
end
end;
get_affiliation(LJID, StateData) ->
get_affiliation(jid:make(LJID), StateData).
Expand Down

0 comments on commit 4a53d4c

Please sign in to comment.