Fixes search by noteID returning a version of the note instead of the address
This commit is contained in:
@@ -2373,8 +2373,21 @@ object LocalCache : ILocalCache, ICacheProvider {
|
|||||||
|
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
val note = getNoteIfExists(key)
|
val note = getNoteIfExists(key)
|
||||||
if ((note != null) && !excludeNoteEventFromSearchResults(note)) {
|
val noteEvent = note?.event
|
||||||
return listOfNotNull(note)
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user