简体   繁体   中英

Ejabberd module do not compile after update

I, i have updated ejabberd from 16.01 to 16.03, i have a problem with my module, before update this line of code

Type = Packet#xmlel.attrs,
    io:format("types:~p~n" , [Type]),
    %Get raw data of message
    Message         = xml:element_to_binary(Packet).

works fine, now after update produce this:

types:[{<<"type">>,<<"chat">>}, {<<"to">>,<<"154@node0.frind.it">>},
       {<<"from">>,<<"121@node0.frind.it">>}]

16:57:13.393 [error] 
{undef,
  [{xml,element_to_binary,
    [{xmlel,<<"message">>,
      [{<<"type">>,<<"chat">>},
       {<<"to">>,<<"154@node0.frind.it">>},
       {<<"from">>,<<"121@node0.frind.it">>}],
      [{xmlel,<<"composing">>,
        [{<<"xmlns">>,<<"http://jabber.org/protocol/chatstates">>}],
        []}]}], []},
   {ejabberd_hooks,safe_apply,3,
     [{file,"src/ejabberd_hooks.erl"},{line,382}]},
   {ejabberd_hooks,run1,3,
     [{file,"src/ejabberd_hooks.erl"},{line,329}]},
   {ejabberd_sm,route,3,
     [{file,"src/ejabberd_sm.erl"},{line,114}]},
   {ejabberd_local,route,3,
     [{file,"src/ejabberd_local.erl"},{line,112}]},
   {ejabberd_router,route,3,
     [{file,"src/ejabberd_router.erl"},{line,77}]},
   {ejabberd_c2s,check_privacy_route,5,
     [{file,"src/ejabberd_c2s.erl"},{line,2110}]},
   {ejabberd_c2s,session_established2,2,
     [{file,"src/ejabberd_c2s.erl"},{line,1271}]}]}

running hook: 
{offline_message_hook,
  [{jid,<<"121">>,<<"node0.frind.it">>,
    <<"97395769126380428951460048231139020">>,<<"121">>,
    <<"node0.frind.it">>,
    <<"97395769126380428951460048231139020">>},
   {jid,<<"154">>,<<"node0.frind.it">>,<<>>,<<"154">>,
    <<"node0.frind.it">>,<<>>},
   {xmlel,<<"message">>,
     [{<<"type">>,<<"chat">>},
      {<<"to">>,<<"154@node0.frind.it">>},
      {<<"from">>,<<"121@node0.frind.it">>}],
  [{xmlel,<<"composing">>,
    [{<<"xmlns">>,<<"http://jabber.org/protocol/chatstates">>}],[]}]}
]}

Anyone can help me?

Latest ejabberd move to library fast_xml . Use fxml module instead of xml .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM