ejabberd-18.12 中钩子 user_receive_packet 的正确语法?

correct syntax for the hook user_receive_packet in ejabberd-18.12?

当前代码:

user_receive_packet({Packet, C2SState}) ->

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

调用挂钩时出错:

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

我猜函数参数是错误的。正确的语法应该是什么?我正在使用 ejabberd-18.12

正确的语法:

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

    {Packet, C2SState}.