Fix crash using Conversations requesting xml/ (#261)

Conversations doesn't set Priority, in that case assume it's zero:
   If no priority is provided, the processing server or client MUST
   consider the priority to be zero ("0").
   https://tools.ietf.org/html/rfc6121#section-4.7.2.3
This commit is contained in:
Badlop 2018-11-07 13:00:33 +01:00
parent 1fcf7b5cb1
commit 18be432fdf
1 changed files with 2 additions and 2 deletions

View File

@ -614,7 +614,7 @@ get_presences({xml, LUser, LServer, Show_us}) ->
attrs = [
{<<"name">>, Presence#presence2.resource},
{<<"show">>, Presence#presence2.show},
{<<"priority">>, iolist_to_binary(integer_to_list(Presence#presence2.priority))}
{<<"priority">>, intund2string(Presence#presence2.priority)}
],
children = [{xmlcdata, Presence#presence2.status}]
}
@ -711,7 +711,7 @@ long_show(<<"xa">>, Lang) -> ?T(<<"extended away">>);
long_show(<<"dnd">>, Lang) -> ?T(<<"do not disturb">>);
long_show(_, Lang) -> ?T(<<"unavailable">>).
intund2string(undefined) -> <<"undefined">>;
intund2string(undefined) -> intund2string(0);
intund2string(Int) when is_integer(Int) -> list_to_binary(integer_to_list(Int)).
escape(S1) ->