Retry failed Matrix backfill messages and persist import progress
Build and Release APK / Build APK (push) Successful in 4m5s

This commit is contained in:
2026-10-18 00:44:23 +02:00
parent 77d3ff7e1e
commit 1a140650af
8 changed files with 268 additions and 29 deletions
@@ -102,8 +102,8 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn
fromMatrix = fromMatrix
)
}
override suspend fun getBackfillMessages(limit: Int): List<Triple<String, String, Boolean>> {
val messagesToSend = mutableListOf<Triple<String, String, Boolean>>()
override suspend fun getBackfillMessages(limit: Int): List<ch.skew.remotrix.bridge.BackfillMessage> {
val messagesToSend = mutableListOf<ch.skew.remotrix.bridge.BackfillMessage>()
Realm.getDefaultInstance().use { realm ->
val threads = realm.where(dev.octoshrimpy.quik.model.Conversation::class.java).findAll()
for (thread in threads) {
@@ -118,7 +118,12 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn
val msgAddress = msg.address.takeIf { it.isNotBlank() } ?: threadAddress
val msgBody = msg.getText(withSubject = false)
if (msgAddress.isNotBlank() && msgBody.isNotBlank()) {
messagesToSend.add(Triple(msgAddress, msgBody, msg.isMe()))
messagesToSend.add(ch.skew.remotrix.bridge.BackfillMessage(
id = "${msg.type}:${msg.contentId}",
address = msgAddress,
body = msgBody,
outgoing = msg.isMe()
))
}
}
}