diff --git a/src/BirdsiteLive.Twitter/TwitterTweetsService.cs b/src/BirdsiteLive.Twitter/TwitterTweetsService.cs index 8278ef5..fdd603c 100644 --- a/src/BirdsiteLive.Twitter/TwitterTweetsService.cs +++ b/src/BirdsiteLive.Twitter/TwitterTweetsService.cs @@ -270,6 +270,19 @@ namespace BirdsiteLive.Twitter MessageContent = MessageContent.Replace(media.GetProperty("url").GetString(), ""); } } + + bool isQuoteTweet = tweet.GetProperty("content").GetProperty("itemContent") + .GetProperty("tweet_results").GetProperty("result").GetProperty("legacy") + .GetProperty("is_quote_status").GetBoolean(); + + if (isQuoteTweet) + { + + string quoteTweetLink = tweet.GetProperty("content").GetProperty("itemContent") + .GetProperty("tweet_results").GetProperty("result").GetProperty("legacy") + .GetProperty("quoted_status_permalink").GetProperty("expanded").GetString(); + MessageContent = MessageContent + "\n" + quoteTweetLink; + } var extractedTweet = new ExtractedTweet { Id = Int64.Parse(tweet.GetProperty("sortIndex").GetString()), diff --git a/src/Tests/BirdsiteLive.Twitter.Tests/TweetTests.cs b/src/Tests/BirdsiteLive.Twitter.Tests/TweetTests.cs index 2ddd069..0fd3bdd 100644 --- a/src/Tests/BirdsiteLive.Twitter.Tests/TweetTests.cs +++ b/src/Tests/BirdsiteLive.Twitter.Tests/TweetTests.cs @@ -75,5 +75,13 @@ namespace BirdsiteLive.ActivityPub.Tests Assert.AreEqual(tweet.Media[0].MediaType, "image/gif"); Assert.IsTrue(tweet.Media[0].Url.StartsWith("https://video.twimg.com/")); } + + [TestMethod] + public async Task SimpleQT() + { + var tweet = await _tweetService.GetTweetAsync(1610807139089383427); + + Assert.AreEqual(tweet.MessageContent, "When you gave them your keys you gave them your coins.\nhttps://twitter.com/kadhim/status/1610706613207285773"); + } } }