Makes NIP-22 posts only visible to the main feed if inside the scope they were placed.

This commit is contained in:
Vitor Pamplona 2024-11-18 16:47:47 -05:00
parent 9e34e9d720
commit fb058f93b6
2 changed files with 6 additions and 2 deletions

View File

@ -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) ||

View File

@ -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 {