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

Fix to not send roster contact from oneself

This commit is contained in:
Badlop 2010-06-10 13:14:09 +02:00
parent cc7ecfb39e
commit cbf06b4785

View File

@ -128,6 +128,7 @@ get_user_roster(Items, {U, S}) when is_binary(U) ->
get_user_roster(Items, {binary_to_list(U), binary_to_list(S)}); get_user_roster(Items, {binary_to_list(U), binary_to_list(S)});
get_user_roster(Items, US) -> get_user_roster(Items, US) ->
{U, S} = US, {U, S} = US,
USB = {list_to_binary(U), list_to_binary(S)},
DisplayedGroups = get_user_displayed_groups(US), DisplayedGroups = get_user_displayed_groups(US),
%% Get shared roster users in all groups and remove self: %% Get shared roster users in all groups and remove self:
SRUsers = SRUsers =
@ -135,9 +136,9 @@ get_user_roster(Items, US) ->
fun(Group, Acc1) -> fun(Group, Acc1) ->
GroupName = get_group_name(S, Group), GroupName = get_group_name(S, Group),
lists:foldl( lists:foldl(
fun(User, Acc2) -> fun(UserServerB, Acc2) ->
if User == US -> Acc2; if UserServerB == USB -> Acc2;
true -> dict:append(User, true -> dict:append(UserServerB,
GroupName, GroupName,
Acc2) Acc2)
end end
@ -498,6 +499,7 @@ get_group_opt(Host, Group, Opt, Default) ->
Default Default
end. end.
%% @spec(Host::string(), Group::string()) -> [{Username::binary(), Server::binary()}]
get_group_users(Host, Group) -> get_group_users(Host, Group) ->
case get_group_opt(Host, Group, all_users, false) of case get_group_opt(Host, Group, all_users, false) of
true -> true ->