From fb058f93b615c42c30363621c0a299a2fdeffe61 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 18 Nov 2024 16:47:47 -0500 Subject: [PATCH] Makes NIP-22 posts only visible to the main feed if inside the scope they were placed. --- .../com/vitorpamplona/amethyst/ui/dal/FilterByListParams.kt | 6 ++++++ .../com/vitorpamplona/quartz/events/ContactListEvent.kt | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/dal/FilterByListParams.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/dal/FilterByListParams.kt index e5e64d1fc..f28fda7e1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/dal/FilterByListParams.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/dal/FilterByListParams.kt @@ -24,6 +24,7 @@ import com.vitorpamplona.amethyst.model.AROUND_ME import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.model.GLOBAL_FOLLOWS import com.vitorpamplona.quartz.encoders.ATag +import com.vitorpamplona.quartz.events.CommentEvent import com.vitorpamplona.quartz.events.Event import com.vitorpamplona.quartz.events.EventInterface import com.vitorpamplona.quartz.events.LiveActivitiesEvent @@ -52,6 +53,11 @@ class FilterByListParams( noteEvent.isTaggedHashes(followLists.hashtags) || noteEvent.isTaggedGeoHashes(followLists.geotags) || noteEvent.isTaggedAddressableNotes(followLists.addresses) + } else if (noteEvent is CommentEvent) { + // ignore follows and checks only the root scope + noteEvent.isTaggedHashes(followLists.hashtags) || + noteEvent.isTaggedGeoHashes(followLists.geotags) || + noteEvent.isTaggedAddressableNotes(followLists.addresses) } else { noteEvent.pubKey in followLists.authors || noteEvent.isTaggedHashes(followLists.hashtags) || diff --git a/quartz/src/main/java/com/vitorpamplona/quartz/events/ContactListEvent.kt b/quartz/src/main/java/com/vitorpamplona/quartz/events/ContactListEvent.kt index cad29aeda..7e5a8db89 100644 --- a/quartz/src/main/java/com/vitorpamplona/quartz/events/ContactListEvent.kt +++ b/quartz/src/main/java/com/vitorpamplona/quartz/events/ContactListEvent.kt @@ -85,8 +85,6 @@ class ContactListEvent( fun unverifiedFollowGeohashSet() = tags.filter { it.size > 1 && it[0] == "g" }.mapNotNull { it.getOrNull(1) } - fun unverifiedFollowAddressSet() = tags.filter { it.size > 1 && it[0] == "a" }.mapNotNull { it.getOrNull(1) } - fun follows() = tags.mapNotNull { try {