Skip to content

Commit

Permalink
Removed From, To, Packet from params in user_send_packet and rest_use…
Browse files Browse the repository at this point in the history
…r_send_packet hook
  • Loading branch information
pawlooss1 committed Sep 28, 2022
1 parent 7aab819 commit 3d083b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/event_pusher/mod_event_pusher_hook_translator.erl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ filter_local_packet({From, To, Acc0, Packet}, _, _) ->

-spec user_send_packet(Acc, Args, Extra) -> {ok, Acc} when
Acc :: mongoose_acc:t(),
Args :: #{from := jid:jid(), to := jid:jid(), packet := exml:element()},
Args :: map(),
Extra :: map().
user_send_packet(Acc, #{from := From, to := To, packet := Packet = #xmlel{name = <<"message">>}}, _) ->
user_send_packet(Acc, _, _) ->
{From, To, Packet} = mongoose_acc:packet(Acc),
ResultAcc = case chat_type(Acc) of
false -> Acc;
Type ->
Expand Down
4 changes: 2 additions & 2 deletions src/mongoose_hooks.erl
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ resend_offline_messages_hook(Acc, JID) ->
Packet :: exml:element(),
Result :: mongoose_acc:t().
rest_user_send_packet(Acc, From, To, Packet) ->
Params = #{from => From, to => To, packet => Packet},
Params = #{},
Args = [From, To, Packet],
ParamsWithLegacyArgs = ejabberd_hooks:add_args(Params, Args),
HostType = mongoose_acc:host_type(Acc),
Expand Down Expand Up @@ -519,7 +519,7 @@ user_sent_keep_alive(HostType, JID) ->
Packet :: exml:element(),
Result :: mongoose_acc:t().
user_send_packet(Acc, From, To, Packet) ->
Params = #{from => From, to => To, packet => Packet},
Params = #{},
Args = [From, To, Packet],
ParamsWithLegacyArgs = ejabberd_hooks:add_args(Params, Args),
HostType = mongoose_acc:host_type(Acc),
Expand Down

0 comments on commit 3d083b2

Please sign in to comment.