Skip to content

Commit

Permalink
Merge pull request #3913 from esl/hooks/simplify_filter_room_packet
Browse files Browse the repository at this point in the history
Simplify filter_room_packet
  • Loading branch information
pawlooss1 authored Jan 2, 2023
2 parents 5523359 + fb2af0d commit f811db6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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

0 comments on commit f811db6

Please sign in to comment.