From 7a7c4d68e48b4f28029667fc4fdf15ca6331301c Mon Sep 17 00:00:00 2001 From: Zed Date: Fri, 20 Sep 2019 01:17:25 +0200 Subject: [PATCH] Hide tweets if they were retweeted on same page --- src/views/timeline.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/timeline.nim b/src/views/timeline.nim index a0d125a..923fc28 100644 --- a/src/views/timeline.nim +++ b/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)