mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Fix roster_tests:get_items
This commit is contained in:
parent
bf068f5659
commit
c9c5839da4
@ -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) ->
|
||||
|
Loading…
Reference in New Issue
Block a user