Fix odd edgecase with broken retweets

This commit is contained in:
Zed 2023-04-01 18:50:04 +02:00
parent 64741de639
commit 34363a2b99

View file

@ -229,8 +229,10 @@ proc parseTweet(js: JsonNode; jsCard: JsonNode = newJNull()): Tweet =
# graphql
with rt, js{"retweeted_status_result", "result"}:
result.retweet = some parseGraphTweet(rt)
return
# needed due to weird edgecase where the actual tweet data isn't included
if "legacy" in rt:
result.retweet = some parseGraphTweet(rt)
return
if jsCard.kind != JNull:
let name = jsCard{"name"}.getStr