Pārlūkot izejas kodu

Hide tweets if they were retweeted on same page

Zed 7 gadi atpakaļ
vecāks
revīzija
7a7c4d68e4
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      src/views/timeline.nim

+ 4 - 1
src/views/timeline.nim

@@ -80,10 +80,13 @@ proc renderTimelineTweets*(results: Result[Tweet]; prefs: Prefs; path: string):
       renderNoneFound()
     else:
       var threads: seq[string]
+      var retweets: seq[string]
       for tweet in results.content:
-        if tweet.threadId in threads: continue
+        if tweet.threadId in threads or tweet.id in retweets: continue
         let thread = results.content.filterIt(threadFilter(it, tweet.threadId))
         if thread.len < 2:
+          if tweet.retweet.isSome:
+            retweets &= tweet.id
           renderTweet(tweet, prefs, path, showThread=tweet.hasThread)
         else:
           renderThread(thread, prefs, path)