Fixes bug when note is not included in the returning set.

pull/167/head
Vitor Pamplona 2023-02-24 12:08:56 -05:00
rodzic b1bdd20255
commit 236177c6ce
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -6,10 +6,10 @@ import kotlin.time.measureTimedValue
class ThreadAssembler {
fun searchRoot(note: Note, testedNotes: MutableSet<Note> = mutableSetOf()): Note? {
testedNotes.add(note)
if (note.replyTo == null || note.replyTo?.isEmpty() == true) return note
testedNotes.add(note)
val markedAsRoot = note.event?.tags?.firstOrNull { it[0] == "e" && it.size > 3 && it[3] == "root" }?.getOrNull(1)
if (markedAsRoot != null) return LocalCache.checkGetOrCreateNote(markedAsRoot)