0
votes

Current code :

user_receive_packet({Packet, C2SState}) ->

    ?INFO_MSG("~p.", [Packet]),
    {Packet, C2SState}.

Getting error when the hook is invoked:

[error] Hook user_receive_packet crashed when running... 
** Reason = {error,function_clause...

I guess the function arguments are wrong. What should be the correct syntax ? I am using ejabberd-18.12

1

1 Answers

0
votes

Correct Syntax:

user_receive_packet({Packet, #{jid := JID} = C2SState}) ->

    {Packet, C2SState}.