更新后Ejabberd模块不编译

时间:2016-04-07 17:05:48

标签: erlang ejabberd

我,我已经从16.01到16.03更新了ejabberd,我的模块有问题,在更新这行代码之前

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

工作正常,现在更新后产生这个:

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">>}],[]}]}
]}

任何人都可以帮助我?

1 个答案:

答案 0 :(得分:2)

最新的ejabberd迁移到图书馆fast_xml。使用fxml模块而不是xml