forked from upstream-mirrors/quik
Retry failed Matrix backfill messages and persist import progress
Build and Release APK / Build APK (push) Successful in 4m5s
Build and Release APK / Build APK (push) Successful in 4m5s
This commit is contained in:
@@ -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()
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user