diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/Note.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/Note.kt index b87d61592..63788310a 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/Note.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/Note.kt @@ -142,7 +142,7 @@ open class Note(val idHex: String) { * This method caches signatures during each execution to avoid recalculation in longer threads */ fun replyLevelSignature( - eventsToConsider: Set, + eventsToConsider: Set, cachedSignatures: MutableMap, account: User, accountFollowingSet: Set, @@ -159,7 +159,7 @@ open class Note(val idHex: String) { val parent = ( replyTo - .filter { it in eventsToConsider } // This forces the signature to be based on a branch, avoiding two roots + .filter { it.idHex in eventsToConsider } // This forces the signature to be based on a branch, avoiding two roots .map { cachedSignatures[it] ?: it.replyLevelSignature( eventsToConsider, diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/ThreadFeedFilter.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/ThreadFeedFilter.kt index 0f028d4bf..a216db8a4 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/ThreadFeedFilter.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/dal/ThreadFeedFilter.kt @@ -18,11 +18,12 @@ class ThreadFeedFilter(val account: Account, val noteId: String) : FeedFilter = mutableMapOf() val followingSet = account.selectedUsersFollowList(KIND3_FOLLOWS) ?: emptySet() val eventsToWatch = ThreadAssembler().findThreadFor(noteId) + val eventsInHex = eventsToWatch.map { it.idHex }.toSet() val now = TimeUtils.now() // Currently orders by date of each event, descending, at each level of the reply stack val order = compareByDescending { - it.replyLevelSignature(eventsToWatch, cachedSignatures, account.userProfile(), followingSet, now).signature + it.replyLevelSignature(eventsInHex, cachedSignatures, account.userProfile(), followingSet, now).signature } return eventsToWatch.sortedWith(order)