Fixes search by noteID returning a version of the note instead of the address

This commit is contained in:
Vitor Pamplona
2026-03-21 15:49:19 -04:00
parent 0dec0164ad
commit 90cced23d2
@@ -2373,8 +2373,21 @@ object LocalCache : ILocalCache, ICacheProvider {
if (key != null) {
val note = getNoteIfExists(key)
if ((note != null) && !excludeNoteEventFromSearchResults(note)) {
return listOfNotNull(note)
val noteEvent = note?.event
val newNote =
if (noteEvent is AddressableEvent) {
val addressableNote = getAddressableNoteIfExists(noteEvent.address())
if (addressableNote?.event?.id == note.idHex) {
addressableNote
} else {
note
}
} else {
note
}
if ((newNote != null) && !excludeNoteEventFromSearchResults(newNote)) {
return listOfNotNull(newNote)
}
}