fix(quote): resolve quoted notes via author's NIP-65 outbox

This commit is contained in:
davotoula
2026-05-15 16:25:11 +02:00
parent 710482e91d
commit a36873b15c
4 changed files with 14 additions and 1 deletions
@@ -2597,7 +2597,11 @@ object LocalCache : ILocalCache, ICacheProvider {
nip19.relay.forEach { relayHint ->
relayHints.addEvent(nip19.hex, relayHint)
}
getOrCreateNote(nip19.hex)
val note = getOrCreateNote(nip19.hex)
val authorHex = nip19.author
if (note.author == null && authorHex != null) {
note.author = checkGetOrCreateUser(authorHex)
}
}
is NEmbed -> {
@@ -34,6 +34,8 @@ fun potentialRelaysToFindEvent(note: Note): Set<NormalizedRelayUrl> {
set.addAll(LocalCache.relayHints.hintsForEvent(note.idHex))
note.author?.outboxRelays()?.let { set.addAll(it) }
LocalCache.getAnyChannel(note)?.relays()?.let { set.addAll(it) }
note.replyTo?.forEach { parentNote ->
@@ -97,6 +97,7 @@ import com.vitorpamplona.amethyst.model.Note
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.model.checkForHashtagWithIcon
import com.vitorpamplona.amethyst.service.CachedRichTextParser
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.UserFinderFilterAssemblerSubscription
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserInfo
import com.vitorpamplona.amethyst.service.uploads.blossom.bud10.openBlossomUriAsIntent
import com.vitorpamplona.amethyst.ui.actions.CrossfadeIfEnabled
@@ -661,6 +662,11 @@ fun BechLink(
val baseNote = loadedLink?.baseNote
// Preload the placeholder's author NIP-65 outbox so a missing quoted event can be fetched from there.
baseNote?.author?.let { author ->
UserFinderFilterAssemblerSubscription(author, accountViewModel)
}
if (canPreview && quotesLeft > 0 && baseNote != null) {
Row {
DisplayFullNote(
@@ -2091,6 +2091,7 @@ class AccountViewModel(
}
is NEvent -> {
LocalCache.consume(parsed)
LocalCache.checkGetOrCreateNote(parsed.hex)?.let { note ->
returningNote = note
}