public Friend GetFriendById(string id) { Friend friend = friendList.GetFriendById(id); if (friend != null) { return(friendList.GetFriendById(id).Copy()); } return(null); }
public async Task <PostList> GetPostToShowByUserId(string userId) { PostList searchList = new PostList(); FriendList friendList = await cloudUserSystem.GetFriendListByUserId(userId); foreach (var post in postList.Posts) { //user's post or friends' post which is not disable user if (friendList.GetFriendById(post.SenderId) != null && !post.IsDisable(userId) || post.SenderId == userId) { searchList.AddPost(post); } } return(searchList); }