From f2843c83b4ea742ab29d9c8b42cba2cd252a9b98 Mon Sep 17 00:00:00 2001 From: Gustaw Lippa Date: Mon, 31 Jan 2022 16:50:15 +0100 Subject: [PATCH] Use host type from Acc, insead of the `To` argument This caused problems with stanzas addressed to a room. --- src/event_pusher/mod_event_pusher_hook_translator.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/event_pusher/mod_event_pusher_hook_translator.erl b/src/event_pusher/mod_event_pusher_hook_translator.erl index d06b452421..1574c0ee3f 100644 --- a/src/event_pusher/mod_event_pusher_hook_translator.erl +++ b/src/event_pusher/mod_event_pusher_hook_translator.erl @@ -48,18 +48,18 @@ stop(Host) -> %%-------------------------------------------------------------------- %% Hook callbacks %%-------------------------------------------------------------------- --type routing_data() :: {jid:jid(), jid:jid(), mongoose_acc:t(), exml:element()}. -spec filter_local_packet(drop) -> drop; - (routing_data()) -> routing_data(). + (mongoose_hooks:filter_packet_acc()) -> mongoose_hooks:filter_packet_acc(). filter_local_packet(drop) -> drop; -filter_local_packet({From, To = #jid{lserver = Host}, Acc0, Packet}) -> +filter_local_packet({From, To, Acc0, Packet}) -> Acc = case chat_type(Acc0) of false -> Acc0; Type -> Event = #chat_event{type = Type, direction = out, from = From, to = To, packet = Packet}, - NewAcc = mod_event_pusher:push_event(Acc0, Host, Event), + HostType = mongoose_acc:host_type(Acc0), + NewAcc = mod_event_pusher:push_event(Acc0, HostType, Event), merge_acc(Acc0, NewAcc) end, {From, To, Acc, Packet}.