Merge pull request #429 from Naveen3Singh/duplication_fixes

Fix Mms duplication on scroll when there aren't many messages
This commit is contained in:
Tibor Kaputa 2022-09-17 14:57:09 +02:00 committed by GitHub
commit 26fe865784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -387,11 +387,12 @@ class ThreadActivity : SimpleActivity() {
ensureBackgroundThread {
val firstItem = messages.first()
val olderMessages = getMessages(threadId, true, oldestMessageDate)
.filter { message -> !messages.contains(message) }
messages.addAll(0, olderMessages)
threadItems = getThreadItems()
allMessagesFetched = olderMessages.size < MESSAGES_LIMIT || olderMessages.size == 0
allMessagesFetched = olderMessages.size < MESSAGES_LIMIT || olderMessages.isEmpty()
runOnUiThread {
loadingOlderMessages = false