diff --git a/server/imserver/asynctaskmgr.cc b/server/imserver/asynctaskmgr.cc index 73d12dc..4b2e22c 100644 --- a/server/imserver/asynctaskmgr.cc +++ b/server/imserver/asynctaskmgr.cc @@ -61,18 +61,22 @@ struct RecommandFriendTask if (context.IsValid()) { std::set& exclude_account_ids = context.hum->GetExcludeAccountIds(); std::set batch_account_ids; + + int my_gameid = f8::ExtractGameIdFromAccountId + (context.account_id); + int my_channel = f8::ExtractChannelIdFromAccountId + (context.account_id); + cs::SMRecommandFriend msg; for (auto& pair : recommand_friends) { if (msg.friend_list_size() < 4) { auto p = msg.add_friend_list() ; *p = pair.second; { - int channel = f8::ExtractChannelIdFromAccountId - (context.account_id); int target_channel = f8::ExtractChannelIdFromAccountId (p->base_data().account_id()); App::Instance()->PreProcAvatarUrl - (channel, + (my_channel, target_channel, *p->mutable_base_data()->mutable_avatar_url()); } @@ -89,15 +93,19 @@ struct RecommandFriendTask } if (exclude_account_ids.find(user_info->base_data().account_id()) == exclude_account_ids.end()) { + int target_gameid = f8::ExtractGameIdFromAccountId + (user_info->base_data().account_id()); + int target_channel = f8::ExtractChannelIdFromAccountId + (user_info->base_data().account_id()); + if (target_gameid != my_gameid || target_channel != my_channel) { + continue; + } + auto p = msg.add_friend_list(); *p = *user_info; { - int channel = f8::ExtractChannelIdFromAccountId - (context.account_id); - int target_channel = f8::ExtractChannelIdFromAccountId - (p->base_data().account_id()); App::Instance()->PreProcAvatarUrl - (channel, + (my_channel, target_channel, *p->mutable_base_data()->mutable_avatar_url()); }