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

Fix roster_tests:get_items

This commit is contained in:
Alexey Shchepin 2021-09-21 13:30:52 +03:00
parent bf068f5659
commit c9c5839da4

View File

@ -224,13 +224,21 @@ get_items(Config, Version) ->
sub_els = [#roster_query{ver = Version}]}) of
#iq{type = result,
sub_els = [#roster_query{ver = NewVersion, items = Items}]} ->
{NewVersion, Items};
{NewVersion, normalize_items(Items)};
#iq{type = result, sub_els = []} ->
{empty, []};
#iq{type = error} = Err ->
xmpp:get_error(Err)
end.
normalize_items(Items) ->
Items2 =
lists:map(
fun(I) ->
I#roster_item{groups = lists:sort(I#roster_item.groups)}
end, Items),
lists:sort(Items2).
get_item(Config, JID) ->
case get_items(Config) of
{_Ver, Items} when is_list(Items) ->