25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

o In #jid, when the node isn't specified, it defaults to the atom

"undefined", not an empty binary.
o  Fix a bug where we expected an #xmlelement to have only one #xmlcdata
child.

SVN Revision: 1593
This commit is contained in:
Jean-Sébastien Pédron 2008-10-02 13:52:39 +00:00
parent 24cb7cb039
commit 9e018532c8
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,10 @@
exmpp_xml:get_element_by_name/2 is deprecated; use
exmpp_xml:get_element/2 instead.
* src/mod_echo.erl: In #jid, when the node isn't specified, it
defaults to the atom "undefined", not an empty binary. Fix a bug where
we expected an #xmlelement to have only one #xmlcdata child.
2008-10-01 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
* src/mod_offline_odbc.erl, src/mod_vcard_odbc.erl,

View File

@ -119,7 +119,7 @@ handle_cast(_Msg, State) ->
%%--------------------------------------------------------------------
handle_info({route, From, To, Packet}, State) ->
Packet2 = case From#jid.node of
<<>> -> exmpp_stanza:reply_with_error(Packet, 'bad-request');
undefined -> exmpp_stanza:reply_with_error(Packet, 'bad-request');
_ -> Packet
end,
do_client_version(disabled, To, From), % Put 'enabled' to enable it
@ -195,7 +195,7 @@ do_client_version(enabled, From, To) ->
after 5000 -> % Timeout in miliseconds: 5 seconds
[]
end,
Values = [{Name, binary_to_list(Value)} || #xmlel{name = Name, children = [#xmlcdata{cdata = Value}]} <- Els],
Values = [{Name, exmpp_xml:get_cdata_as_list(Children)} || #xmlel{name = Name, children = Children} <- Els],
%% Print in log
Values_string1 = [io_lib:format("~n~s: ~p", [N, V]) || {N, V} <- Values],