-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
The Nostr nevent can contain the event's author, which should be added after verification. For URIs that don't contain the event author, wisp should search for the event author and add it if found.
private fun extractNostrRefs(content: String): Pair<Set<String>, Set<String>> {
val pubkeys = mutableSetOf<String>()
val eventIds = mutableSetOf<String>()
for (match in NOSTR_URI_REGEX.findAll(content)) {
val bech32 = match.groupValues[1]
try {
when (val data = Nip19.decodeNostrUri("nostr:$bech32")) {
is com.wisp.app.nostr.NostrUriData.ProfileRef -> pubkeys.add(data.pubkey)
is com.wisp.app.nostr.NostrUriData.NoteRef -> eventIds.add(data.eventId)
is com.wisp.app.nostr.NostrUriData.AddressRef -> {}
null -> {}
}
} catch (_: Exception) {}
}
return pubkeys to eventIds
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels