From c925b82e86b89df93449e15ce274699b27124036 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 23 Jun 2023 14:30:26 -0400 Subject: [PATCH] Stops showing posts in the future --- .../amethyst/ui/dal/HomeConversationsFeedFilter.kt | 3 +++ .../vitorpamplona/amethyst/ui/dal/HomeNewThreadFeedFilter.kt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/HomeConversationsFeedFilter.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/HomeConversationsFeedFilter.kt index 4ee3b1b26..32ca8aa3a 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/HomeConversationsFeedFilter.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/HomeConversationsFeedFilter.kt @@ -26,6 +26,8 @@ class HomeConversationsFeedFilter(val account: Account) : AdditiveFeedFilter() val followingKeySet = account.selectedUsersFollowList(account.defaultHomeFollowList) ?: emptySet() val followingTagSet = account.selectedTagsFollowList(account.defaultHomeFollowList) ?: emptySet() + val now = System.currentTimeMillis() / 1000 val oneHr = 60 * 60 return collection @@ -41,6 +42,7 @@ class HomeNewThreadFeedFilter(val account: Account) : AdditiveFeedFilter() (it.author?.pubkeyHex in followingKeySet || (noteEvent.isTaggedHashes(followingTagSet))) && // && account.isAcceptable(it) // This filter follows only. No need to check if acceptable it.author?.let { !account.isHidden(it.pubkeyHex) } ?: true && + ((it.event?.createdAt() ?: 0) < now) && it.isNewThread() && ( (noteEvent !is RepostEvent && noteEvent !is GenericRepostEvent) || // not a repost