示例#1
0
        /// <summary>
        /// ユーザーのフォロー状況を取得
        /// </summary>
        /// <param name="user">相手ユーザーデータ</param>
        private async void LoadRelationship(User user)
        {
            if (user == null)
            {
                return;
            }

            var relationship = await AccountTokens.ShowRelationshipAsync(this.TimelineModel.TokenSuffix, user.Id);

            if (relationship != null)
            {
                if (relationship.Source.Id == relationship.Target.Id)
                {
                    this.IsOwn = true;
                }

                if (relationship.Source.IsBlocking != null)
                {
                    this.IsBlocking = (bool)relationship.Source.IsBlocking;
                }

                this.IsFollowing = relationship.Source.IsFollowing;
                if (relationship.Source.IsFollowingRequested != null)
                {
                    this.IsSendingFollowRequest = (bool)relationship.Source.IsFollowingRequested;
                }
            }
        }