Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify filter_room_packet #3913

Merged
merged 1 commit into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mam/mod_mam_muc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ disco_muc_features(Acc, _Params, _Extra) ->
%% @doc Handle public MUC-message.
-spec filter_room_packet(Acc, Params, Extra) -> {ok, Acc} when
Acc :: exml:element(),
Params :: map(),
Params :: mod_muc:room_event_data(),
Extra :: gen_hook:extra().
filter_room_packet(Packet, #{event_data := #{} = EventData}, #{host_type := HostType}) ->
filter_room_packet(Packet, EventData, #{host_type := HostType}) ->
?LOG_DEBUG(#{what => mam_room_packet, text => <<"Incoming room packet">>,
packet => Packet, event_data => EventData}),
IsArchivable = is_archivable_message(HostType, incoming, Packet),
Expand Down
3 changes: 1 addition & 2 deletions src/mongoose_hooks.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1390,8 +1390,7 @@ amp_verify_support(HostType, Rules) ->
EventData :: mod_muc:room_event_data(),
Result :: exml:element().
filter_room_packet(HostType, Packet, EventData) ->
Params = #{packet => Packet, event_data => EventData},
run_hook_for_host_type(filter_room_packet, HostType, Packet, Params).
run_hook_for_host_type(filter_room_packet, HostType, Packet, EventData).

%%% @doc The `forget_room' hook is called when a room is removed from the database.
-spec forget_room(HostType, MucHost, Room) -> Result when
Expand Down