Skip to content

Commit

Permalink
Fix handling of 3PI events in mod_matrix_gw_room
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyshch committed Jan 20, 2025
1 parent e589265 commit e7035f3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mod_matrix_gw_room.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1232,8 +1232,14 @@ check_event_auth(Event, StateMap, Data) ->
<<"join">>}}}} ->
case Event#event.type of
?ROOM_3PI ->
%% TODO
{todo, Event};
SenderLevel = get_user_power_level(Event#event.sender, StateMap, Data),
InviteLevel =
case maps:find({?ROOM_POWER_LEVELS, <<"">>}, StateMap) of
{ok, #event{json = #{<<"content">> := #{<<"invite">> := S}}}} ->
get_int(S);
_ -> 0
end,
SenderLevel >= InviteLevel;
_ ->
case check_event_power_level(
Event, StateMap, Data) of
Expand Down

0 comments on commit e7035f3

Please sign in to comment.