Deduplicate note tweet parsing

This commit is contained in:
Zed
2023-03-03 21:19:21 +01:00
parent 368974c803
commit aea884c48e
3 changed files with 35 additions and 65 deletions

View File

@@ -204,12 +204,12 @@ proc parseTweet(js: JsonNode; jsCard: JsonNode = newJNull()): Tweet =
)
)
result.expandTweetEntities(js)
# fix for pinned threads
if result.hasThread and result.threadId == 0:
result.threadId = js{"self_thread", "id_str"}.getId
result.expandTweetEntities(js)
if js{"is_quote_status"}.getBool:
result.quote = some Tweet(id: js{"quoted_status_id_str"}.getId)