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:
parent
bf068f5659
commit
c9c5839da4
@ -224,13 +224,21 @@ get_items(Config, Version) ->
|
|||||||
sub_els = [#roster_query{ver = Version}]}) of
|
sub_els = [#roster_query{ver = Version}]}) of
|
||||||
#iq{type = result,
|
#iq{type = result,
|
||||||
sub_els = [#roster_query{ver = NewVersion, items = Items}]} ->
|
sub_els = [#roster_query{ver = NewVersion, items = Items}]} ->
|
||||||
{NewVersion, Items};
|
{NewVersion, normalize_items(Items)};
|
||||||
#iq{type = result, sub_els = []} ->
|
#iq{type = result, sub_els = []} ->
|
||||||
{empty, []};
|
{empty, []};
|
||||||
#iq{type = error} = Err ->
|
#iq{type = error} = Err ->
|
||||||
xmpp:get_error(Err)
|
xmpp:get_error(Err)
|
||||||
end.
|
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) ->
|
get_item(Config, JID) ->
|
||||||
case get_items(Config) of
|
case get_items(Config) of
|
||||||
{_Ver, Items} when is_list(Items) ->
|
{_Ver, Items} when is_list(Items) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user