From fb2af0db9cbec3cd8a12948a7a499bec1af57f9f Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Mon, 2 Jan 2023 11:11:08 +0100 Subject: [PATCH] Simplify filter_room_packet --- src/mam/mod_mam_muc.erl | 4 ++-- src/mongoose_hooks.erl | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mam/mod_mam_muc.erl b/src/mam/mod_mam_muc.erl index 06160e707fa..34334e932b4 100644 --- a/src/mam/mod_mam_muc.erl +++ b/src/mam/mod_mam_muc.erl @@ -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), diff --git a/src/mongoose_hooks.erl b/src/mongoose_hooks.erl index be261636099..636c755e92e 100644 --- a/src/mongoose_hooks.erl +++ b/src/mongoose_hooks.erl @@ -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