Removes reposts from the Dot Notification in the home's bottom bar icon

This commit is contained in:
Vitor Pamplona
2024-05-20 16:45:08 -04:00
parent 666635811b
commit fc27526113
@@ -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<Note>,
account: Account,
): Set<Note> {
// removes reposts from the dot notifications.
return newItems.filter { it.event !is GenericRepostEvent && it.event !is RepostEvent }.toSet()
}
}
object NotificationLatestItem : LatestItem() {