aboutsummaryrefslogtreecommitdiff
path: root/src/jlib.erl
diff options
context:
space:
mode:
authorJerome Sautret <jerome.sautret@process-one.net>2014-07-04 15:21:40 +0200
committerJerome Sautret <jerome.sautret@process-one.net>2014-07-04 15:21:40 +0200
commit26a4d91297a7d7400dbdd30a063e163afa83fb22 (patch)
treefa63eb7b5faa92daaab7cfe6afcaeaf29dd968b6 /src/jlib.erl
parentadd ability to rotate logs on given date condition (diff)
Fix IQ XML generation.
Diffstat (limited to 'src/jlib.erl')
-rw-r--r--src/jlib.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/jlib.erl b/src/jlib.erl
index 7735d7dbc..549c9b71b 100644
--- a/src/jlib.erl
+++ b/src/jlib.erl
@@ -451,15 +451,23 @@ iq_type_to_string(error) -> <<"error">>.
).
iq_to_xml(#iq{id = ID, type = Type, sub_el = SubEl}) ->
+ Children = case Type of
+ set ->
+ [SubEl];
+ get ->
+ [SubEl];
+ _ ->
+ SubEl
+ end,
if ID /= <<"">> ->
#xmlel{name = <<"iq">>,
attrs =
[{<<"id">>, ID}, {<<"type">>, iq_type_to_string(Type)}],
- children = SubEl};
+ children = Children};
true ->
#xmlel{name = <<"iq">>,
attrs = [{<<"type">>, iq_type_to_string(Type)}],
- children = SubEl}
+ children = Children}
end.
-spec(parse_xdata_submit/1 ::
@@ -800,7 +808,7 @@ base64_to_term(Base64) ->
decode_base64(S) ->
decode_base64_bin(S, <<>>).
-take_without_spaces(Bin, Count) ->
+take_without_spaces(Bin, Count) ->
take_without_spaces(Bin, Count, <<>>).
take_without_spaces(Bin, 0, Acc) ->