Use faster API to get pinned tweets

This commit is contained in:
Zed
2022-01-23 07:45:01 +01:00
parent 51ae076ea0
commit 27183f1a74
5 changed files with 13 additions and 3 deletions

View File

@@ -372,6 +372,11 @@ proc parseConversation*(js: JsonNode; tweetId: string): Conversation =
elif "cursor-bottom" in entry:
result.replies.bottom = e.getCursor
proc parseStatus*(js: JsonNode): Tweet =
result = parseTweet(js)
if not result.isNil:
result.user = parseUser(js{"user"})
proc parseInstructions[T](res: var Result[T]; global: GlobalObjects; js: JsonNode) =
if js.kind != JArray or js.len == 0:
return