Fixes NIP-22 identifier for geotags

This commit is contained in:
Vitor Pamplona
2025-05-19 17:42:16 -04:00
parent ba71c95bec
commit a5e8bdd43a
2 changed files with 9 additions and 1 deletions
@@ -74,6 +74,14 @@ class CommentEvent(
fun replyAuthors() = tags.filter(ReplyAuthorTag::match)
fun rootAuthorKeys() = tags.mapNotNull(RootAuthorTag::parseKey)
fun replyAuthorKeys() = tags.mapNotNull(ReplyAuthorTag::parseKey)
fun rootAuthorHints() = tags.mapNotNull(RootAuthorTag::parseAsHint)
fun replyAuthorHints() = tags.mapNotNull(ReplyAuthorTag::parseAsHint)
fun rootScopes() = tags.filter { RootIdentifierTag.match(it) || RootAddressTag.match(it) || RootEventTag.match(it) }
fun rootKinds() = tags.filter(RootKindTag::match)
@@ -54,7 +54,7 @@ class RootIdentifierTag {
@JvmStatic
fun assemble(id: ExternalId): List<Array<String>> =
when (id) {
is GeohashId -> GeoHashTag.geoMipMap(id.geohash).map { assemble(it, id.hint) }
is GeohashId -> GeoHashTag.geoMipMap(id.geohash).map { assemble(GeohashId.toScope(it), id.hint) }
else -> listOf(assemble(id.toScope(), id.hint()))
}
}