From fc275261131e68e95ec5a29815c9d54abf2706cc Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 20 May 2024 16:45:08 -0400 Subject: [PATCH] Removes reposts from the Dot Notification in the home's bottom bar icon --- .../com/vitorpamplona/amethyst/ui/navigation/Routes.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/navigation/Routes.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/navigation/Routes.kt index b9d0089c8..d79571274 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/navigation/Routes.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/navigation/Routes.kt @@ -45,6 +45,8 @@ import com.vitorpamplona.amethyst.ui.theme.Size23dp import com.vitorpamplona.amethyst.ui.theme.Size24dp import com.vitorpamplona.amethyst.ui.theme.Size25dp import com.vitorpamplona.quartz.events.ChatroomKeyable +import com.vitorpamplona.quartz.events.GenericRepostEvent +import com.vitorpamplona.quartz.events.RepostEvent import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toImmutableList @@ -320,6 +322,14 @@ object HomeLatestItem : LatestItem() { return (newestItem?.createdAt() ?: 0) > lastTime } + + override fun filterMore( + newItems: Set, + account: Account, + ): Set { + // removes reposts from the dot notifications. + return newItems.filter { it.event !is GenericRepostEvent && it.event !is RepostEvent }.toSet() + } } object NotificationLatestItem : LatestItem() {