当前代码:
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
答案 0 :(得分:0)
正确的语法:
user_receive_packet({Packet, #{jid := JID} = C2SState}) ->
{Packet, C2SState}.