From 3936edb3b75a4daad71b45cb2b65e27e201fab9d Mon Sep 17 00:00:00 2001 From: Milu Lu Date: Sat, 25 Mar 2023 18:04:46 +0800 Subject: [PATCH] Do not show notes with the creation time exceeding the current time, as they will always stay at the top of the global feed, which is cheating. --- .../com/vitorpamplona/amethyst/ui/dal/GlobalFeedFilter.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/GlobalFeedFilter.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/GlobalFeedFilter.kt index e2ad47575..ffed429cc 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/GlobalFeedFilter.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/GlobalFeedFilter.kt @@ -27,6 +27,10 @@ object GlobalFeedFilter : FeedFilter() { (it.author?.pubkeyHex !in followUsers) } .filter { account.isAcceptable(it) } + .filter { + // Do not show notes with the creation time exceeding the current time, as they will always stay at the top of the global feed, which is cheating. + it.createdAt()!! <= System.currentTimeMillis() / 1000 + } .toList() val longFormNotes = LocalCache.addressables.values @@ -41,6 +45,10 @@ object GlobalFeedFilter : FeedFilter() { (it.author?.pubkeyHex !in followUsers) } .filter { account.isAcceptable(it) } + .filter { + // Do not show notes with the creation time exceeding the current time, as they will always stay at the top of the global feed, which is cheating. + it.createdAt()!! <= System.currentTimeMillis() / 1000 + } .toList() return (notes + longFormNotes)