Skip to content

Commit 968fbc9

Browse files
committed
Fix compilation on <R25
1 parent 7862c6a commit 968fbc9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/ejabberd_auth_mnesia.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,13 @@ get_users(Server, []) ->
151151
Users = mnesia:dirty_select(passwd,
152152
[{#passwd{us = '$1', _ = '_'},
153153
[{'==', {element, 2, '$1'}, Server}], ['$1']}]),
154-
lists:uniq(lists:map(fun({U, S, _}) -> {U, S} end, Users));
154+
{_, Res} = lists:foldl(
155+
fun({U, S, _}, {{U2, S2}, _} = Acc) when U == U2 andalso S == S2 ->
156+
Acc;
157+
({U, S, _}, {_, Res}) ->
158+
{{U, S}, [{U, S} | Res]}
159+
end, {{none, none}, []}, Users),
160+
Res;
155161
get_users(Server, [{from, Start}, {to, End}])
156162
when is_integer(Start) and is_integer(End) ->
157163
get_users(Server, [{limit, End - Start + 1}, {offset, Start}]);

0 commit comments

Comments
 (0)