fix replies

This commit is contained in:
Vincent Cloutier 2023-01-14 11:16:21 -05:00
parent cffc1db3e6
commit 2623271c65
2 changed files with 11 additions and 1 deletions

View file

@ -69,7 +69,7 @@ namespace BirdsiteLive.Twitter
var timeline = tweet.RootElement.GetProperty("data").GetProperty("threaded_conversation_with_injections_v2")
.GetProperty("instructions").EnumerateArray().First().GetProperty("entries").EnumerateArray();
return await Extract( timeline.First() );
return await Extract( timeline.Where(x => x.GetProperty("entryId").GetString() == "tweet-" + statusId).ToArray().First() );
}
catch (Exception e)
{

View file

@ -83,5 +83,15 @@ namespace BirdsiteLive.ActivityPub.Tests
Assert.AreEqual(tweet.MessageContent, "When you gave them your keys you gave them your coins.\nhttps://twitter.com/kadhim/status/1610706613207285773");
}
[TestMethod]
public async Task SimpleReply()
{
var tweet = await _tweetService.GetTweetAsync(1445468404815597573);
Assert.AreEqual(tweet.InReplyToAccount, "punk6529");
Assert.AreEqual(tweet.InReplyToStatusId, 1445468401745289235);
Assert.IsTrue(tweet.IsReply);
}
}
}