Use legacy timeline/user endpoint for Tweets tab

This commit is contained in:
Zed
2023-08-08 02:09:56 +02:00
parent 5725780c99
commit 624394430c
8 changed files with 81 additions and 38 deletions

View File

@@ -53,7 +53,7 @@ proc fetchProfile*(after: string; query: Query; skipRail=false;
result =
case query.kind
# of posts: await getTimeline(userId, after)
of posts: await getUserTimeline(userId, after)
of replies: await getGraphUserTweets(userId, TimelineKind.replies, after)
of media: await getGraphUserTweets(userId, TimelineKind.media, after)
else: Profile(tweets: await getTweetSearch(query, after))
@@ -63,21 +63,6 @@ proc fetchProfile*(after: string; query: Query; skipRail=false;
result.tweets.query = query
if result.user.protected or result.user.suspended:
return
if query.kind == posts:
if result.user.verified:
for chain in result.tweets.content:
if chain[0].user.id == result.user.id:
chain[0].user.verified = true
if not skipPinned and result.user.pinnedTweet > 0 and after.len == 0:
let tweet = await getCachedTweet(result.user.pinnedTweet)
if not tweet.isNil:
tweet.pinned = true
tweet.user = result.user
result.pinned = some tweet
proc showTimeline*(request: Request; query: Query; cfg: Config; prefs: Prefs;
rss, after: string): Future[string] {.async.} =
if query.fromUser.len != 1: