private void Follow(Topic topic) { Communities.Follow(FollowQuery.Topics(topic.Id), count => { Refresh(topic); }, error => _console.LogE(error.Message)); }
private void Unfollow(User user) { Communities.Unfollow(FollowQuery.Users(UserIdList.Create(user.Id)), count => { _follows[user.Id] = false; }, error => _console.LogE(error.Message)); }
private void IsFollowing() { Communities.IsFollowing(UserId.CurrentUser(), FollowQuery.Users(FormUserList()), follows => { _console.LogD("Current user is following: " + follows.ToDebugString()); }, OnError); }
private void Follow() { Communities.Follow(FollowQuery.Users(FormUserList()), newFollows => { _console.LogD("Followed user, total: " + newFollows); }, OnError); }
protected void ShowActions(User user) { Communities.IsFollowing(UserId.CurrentUser(), FollowQuery.Users(UserIdList.Create(user.Id)), result => { var isFollower = result.ContainsKey(user.Id) && result[user.Id]; Communities.IsFriend(UserId.Create(user.Id), isFriend => { ShowActions(user, isFollower, isFriend); }, error => _console.LogE(error.ToString())); }, error => _console.LogE(error.ToString())); }
protected override void OnDataChanged(List <User> list) { if (list.Count == 0) { return; } var users = UserIdList.Create(list.ConvertAll(it => it.Id)); Communities.AreFriends(users, areFriends => { _areFriends.AddAll(areFriends); }, error => _console.LogE(error.Message)); Communities.IsFollowing(UserId.CurrentUser(), FollowQuery.Users(users), follows => { _follows.AddAll(follows); }, error => _console.LogE(error.Message)); }
private void Unfollow(User user) { Communities.Unfollow(FollowQuery.Users(UserIdList.Create(user.Id)), count => { _console.LogD($"Unfollowed User: {count}", false); }, error => _console.LogE(error.Message)); }