From 8bcd8abd511d52553a3350fd06c854a6533ab6bb Mon Sep 17 00:00:00 2001 From: Joe Mayo Date: Fri, 24 Apr 2020 18:06:31 -0700 Subject: [PATCH] Fixed a bug with retweets. --- .../LinqToTwitter5/net48/CSharp/ConsoleSamples/StatusDemos.cs | 2 +- .../Status/TwitterContextStatusCommands.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Samples/LinqToTwitter5/net48/CSharp/ConsoleSamples/StatusDemos.cs b/Samples/LinqToTwitter5/net48/CSharp/ConsoleSamples/StatusDemos.cs index 3f3b58ae..1f19e1b6 100644 --- a/Samples/LinqToTwitter5/net48/CSharp/ConsoleSamples/StatusDemos.cs +++ b/Samples/LinqToTwitter5/net48/CSharp/ConsoleSamples/StatusDemos.cs @@ -378,7 +378,7 @@ static async Task ReplyAsync(TwitterContext twitterCtx) static async Task RetweetAsync(TwitterContext twitterCtx) { - ulong tweetID = 401033367283453953; + ulong tweetID = 1250088275861049345; Status retweet = await twitterCtx.RetweetAsync(tweetID); diff --git a/src/LinqToTwitter5/LinqToTwitter.Shared/Status/TwitterContextStatusCommands.cs b/src/LinqToTwitter5/LinqToTwitter.Shared/Status/TwitterContextStatusCommands.cs index 448924e0..b6e218d2 100644 --- a/src/LinqToTwitter5/LinqToTwitter.Shared/Status/TwitterContextStatusCommands.cs +++ b/src/LinqToTwitter5/LinqToTwitter.Shared/Status/TwitterContextStatusCommands.cs @@ -377,12 +377,12 @@ await TwitterExecutor.PostFormUrlEncodedToTwitterAsync( /// /// ID of tweet being retweeted. /// Retweeted tweet. - public virtual async Task RetweetAsync(ulong tweetID, TweetMode tweetMode = TweetMode.Compat, CancellationToken cancelToken = default(CancellationToken)) + public virtual async Task RetweetAsync(ulong tweetID, CancellationToken cancelToken = default(CancellationToken)) { if (tweetID == MissingID) throw new ArgumentException("0 is *not* a valid tweetID. You must provide the ID of the tweet you're retweeting.", "tweetID"); - var retweetUrl = BaseUrl + "statuses/retweet/" + tweetID + ".json?tweet_mode=" + tweetMode.ToString().ToLower(); + var retweetUrl = BaseUrl + "statuses/retweet/" + tweetID + ".json"; RawResult = await TwitterExecutor .PostFormUrlEncodedToTwitterAsync(HttpMethod.Post.ToString(), retweetUrl, new Dictionary(), cancelToken)