{
public interface ISocialProtocolMutation
{
+ public Task DeletePost(PostId postId);
+
public Task FavoritePost(PostId postId);
public Task UnfavoritePost(PostId postId);
this.account = account;
}
+ public async Task DeletePost(PostId postId)
+ {
+ var statusId = this.AssertTwitterStatusId(postId);
+ var request = new DeleteTweetRequest
+ {
+ TweetId = statusId,
+ };
+
+ await request.Send(this.account.Legacy.Api.Connection)
+ .ConfigureAwait(false);
+ }
+
public async Task FavoritePost(PostId postId)
{
var statusId = this.AssertTwitterStatusId(postId);
this.account = account;
}
+ public async Task DeletePost(PostId postId)
+ {
+ var statusId = this.AssertTwitterStatusId(postId);
+
+ await this.account.Legacy.Api.StatusesDestroy(statusId)
+ .IgnoreResponse();
+ }
+
public async Task FavoritePost(PostId postId)
{
var statusId = this.AssertTwitterStatusId(postId);
{
// 他人に RT された自分のツイート
// => RT 元の自分のツイートを削除
- await this.tw.DeleteTweet(post.RetweetedId.ToTwitterStatusId());
+ await this.CurrentTabAccount.Mutation.DeletePost(post.RetweetedId);
}
else
{
// 自分のツイート
// => ツイートを削除
- await this.tw.DeleteTweet(post.StatusId.ToTwitterStatusId());
+ await this.CurrentTabAccount.Mutation.DeletePost(post.StatusId);
}
}
}
return post;
}
- public async Task DeleteTweet(TwitterStatusId tweetId)
- {
- if (this.Api.AuthType == APIAuthType.TwitterComCookie)
- {
- var request = new DeleteTweetRequest
- {
- TweetId = tweetId,
- };
- await request.Send(this.Api.Connection);
- }
- else
- {
- await this.Api.StatusesDestroy(tweetId)
- .IgnoreResponse();
- }
- }
-
public async Task<long> UploadMedia(IMediaItem item, string? mediaCategory = null)
{
this.CheckAccountState();