private void OnUserAvatarClicked(User publicUser) { if (GetSocial.GetCurrentUser().Id.Equals(publicUser.Id)) { var popup = new MNPopup("Action", "Choose Action"); popup.AddAction("Show My Feed", () => OpenUserGlobalFeed(publicUser)); popup.AddAction("Cancel", () => { }); popup.Show(); } else { Communities.IsFriend(UserId.Create(publicUser.Id), isFriend => { if (isFriend) { var popup = new MNPopup("Action", "Choose Action"); popup.AddAction("Show " + publicUser.DisplayName + " Feed", () => OpenUserGlobalFeed(publicUser)); popup.AddAction("Remove from Friends", () => RemoveFriend(publicUser)); popup.AddAction("Cancel", () => { }); popup.Show(); } else { var popup = new MNPopup("Action", "Choose Action"); popup.AddAction("Show " + publicUser.DisplayName + " Feed", () => OpenUserGlobalFeed(publicUser)); popup.AddAction("Add to Friends", () => AddFriend(publicUser)); popup.AddAction("Cancel", () => { }); popup.Show(); } }, error => _console.LogE("Failed to check if friends with " + publicUser.DisplayName + ", error:" + error.Message)); } }
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())); }