Update mod_rest to work with ejabberd 16.02

This commit is contained in:
Holger Weiss 2016-03-08 00:35:30 +01:00
parent 04cc600772
commit c5daf56385
1 changed files with 3 additions and 3 deletions

View File

@ -64,9 +64,9 @@ process(Path, Request) ->
%% Otherwise, it is considered an ejabberd command to execute.
maybe_post_request(<<$<,_/binary>> = Data, Host, ClientIp) ->
try
Stanza = {xmlel, _, _, _} = xml_stream:parse_element(Data),
From = jlib:string_to_jid(xml:get_tag_attr_s(<<"from">>, Stanza)),
To = jlib:string_to_jid(xml:get_tag_attr_s(<<"to">>, Stanza)),
Stanza = {xmlel, _, _, _} = fxml_stream:parse_element(Data),
From = jlib:string_to_jid(fxml:get_tag_attr_s(<<"from">>, Stanza)),
To = jlib:string_to_jid(fxml:get_tag_attr_s(<<"to">>, Stanza)),
allowed = check_stanza(Stanza, From, To, Host),
?INFO_MSG("Got valid request from ~s~nwith IP ~p~nto ~s:~n~p",
[jlib:jid_to_string(From),