OpenTween.Twitter.PostRetweet C# (CSharp) Method

PostRetweet() public method

public PostRetweet ( long id, bool read ) : System.Threading.Task
id long
read bool
return System.Threading.Task
        public async Task PostRetweet(long id, bool read)
        {
            this.CheckAccountState();

            //データ部分の生成
            var post = TabInformations.GetInstance()[id];
            if (post == null)
                throw new WebApiException("Err:Target isn't found.");

            var target = post.RetweetedId ?? id;  //再RTの場合は元発言をRT

            var response = await this.Api.StatusesRetweet(target)
                .ConfigureAwait(false);

            var status = await response.LoadJsonAsync()
                .ConfigureAwait(false);

            //二重取得回避
            lock (LockObj)
            {
                if (TabInformations.GetInstance().ContainsKey(status.Id))
                    return;
            }

            //Retweet判定
            if (status.RetweetedStatus == null)
                throw new WebApiException("Invalid Json!");

            //ReTweetしたものをTLに追加
            post = CreatePostsFromStatusData(status);
            
            //ユーザー情報
            post.IsMe = true;

            post.IsRead = read;
            post.IsOwl = false;
            if (_readOwnPost) post.IsRead = true;
            post.IsDm = false;

            TabInformations.GetInstance().AddPost(post);
        }