From cbf06b4785db0f2dbea84ba37bc1303426d5b01e Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 10 Jun 2010 13:14:09 +0200 Subject: [PATCH] Fix to not send roster contact from oneself --- src/mod_shared_roster.erl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mod_shared_roster.erl b/src/mod_shared_roster.erl index c7f68a273..e02a0577a 100644 --- a/src/mod_shared_roster.erl +++ b/src/mod_shared_roster.erl @@ -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, US) -> {U, S} = US, + USB = {list_to_binary(U), list_to_binary(S)}, DisplayedGroups = get_user_displayed_groups(US), %% Get shared roster users in all groups and remove self: SRUsers = @@ -135,9 +136,9 @@ get_user_roster(Items, US) -> fun(Group, Acc1) -> GroupName = get_group_name(S, Group), lists:foldl( - fun(User, Acc2) -> - if User == US -> Acc2; - true -> dict:append(User, + fun(UserServerB, Acc2) -> + if UserServerB == USB -> Acc2; + true -> dict:append(UserServerB, GroupName, Acc2) end @@ -498,6 +499,7 @@ get_group_opt(Host, Group, Opt, Default) -> Default end. +%% @spec(Host::string(), Group::string()) -> [{Username::binary(), Server::binary()}] get_group_users(Host, Group) -> case get_group_opt(Host, Group, all_users, false) of true ->