mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
Revert "Update room previews once we have decryption keys"
Upstream implemented this now as well (differently).
This reverts commit 0d6eda56f5
Change-Id: I74a59ed3e9baf8122c506b4af66a9d1809720600
This commit is contained in:
parent
c5e69cf35a
commit
130fe7f887
2 changed files with 0 additions and 30 deletions
|
@ -17,9 +17,6 @@
|
|||
package org.matrix.android.sdk.internal.crypto.actions
|
||||
|
||||
import androidx.annotation.WorkerThread
|
||||
import com.zhuinden.monarchy.Monarchy
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.listeners.ProgressListener
|
||||
import org.matrix.android.sdk.api.session.crypto.model.ImportRoomKeysResult
|
||||
import org.matrix.android.sdk.api.session.crypto.model.RoomKeyRequestBody
|
||||
|
@ -29,17 +26,12 @@ import org.matrix.android.sdk.internal.crypto.OutgoingGossipingRequestManager
|
|||
import org.matrix.android.sdk.internal.crypto.RoomDecryptorProvider
|
||||
import org.matrix.android.sdk.internal.crypto.algorithms.megolm.MXMegolmDecryption
|
||||
import org.matrix.android.sdk.internal.crypto.store.IMXCryptoStore
|
||||
import org.matrix.android.sdk.internal.di.SessionDatabase
|
||||
import org.matrix.android.sdk.internal.session.room.summary.RoomSummaryUpdater
|
||||
import org.matrix.android.sdk.internal.util.awaitTransaction
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
internal class MegolmSessionDataImporter @Inject constructor(private val olmDevice: MXOlmDevice,
|
||||
private val roomDecryptorProvider: RoomDecryptorProvider,
|
||||
@SessionDatabase private val monarchy: Monarchy,
|
||||
private val roomSummaryUpdater: RoomSummaryUpdater,
|
||||
private val cryptoCoroutineScope: CoroutineScope,
|
||||
private val outgoingGossipingRequestManager: OutgoingGossipingRequestManager,
|
||||
private val cryptoStore: IMXCryptoStore) {
|
||||
|
||||
|
@ -116,13 +108,6 @@ internal class MegolmSessionDataImporter @Inject constructor(private val olmDevi
|
|||
|
||||
Timber.v("## importMegolmSessionsData : sessions import " + (t1 - t0) + " ms (" + megolmSessionsData.size + " sessions)")
|
||||
|
||||
// Retry decrypting room previews for the room list
|
||||
cryptoCoroutineScope.launch {
|
||||
monarchy.awaitTransaction { realm ->
|
||||
roomSummaryUpdater.updateRoomPreviews(realm)
|
||||
}
|
||||
}
|
||||
|
||||
return ImportRoomKeysResult(totalNumbersOfKeys, totalNumbersOfImportedKeys)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,21 +215,6 @@ internal class RoomSummaryUpdater @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
suspend fun updateRoomPreviews(realm: Realm) {
|
||||
RoomSummaryEntity.where(realm).findAll().forEach { entity ->
|
||||
val previewEvent = entity.scLatestPreviewableEvent()
|
||||
val root = previewEvent?.root
|
||||
if (root?.type == EventType.ENCRYPTED && root.decryptionResultJson == null) {
|
||||
Timber.v("Retry decrypt ${previewEvent.eventId}")
|
||||
// mmm i want to decrypt now or is it ok to do it async?
|
||||
tryOrNull {
|
||||
eventDecryptor.decryptEvent(root.asDomain(), "")
|
||||
}
|
||||
?.let { root.setDecryptionResult(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun TimelineEventEntity.attemptToDecrypt() {
|
||||
when (val root = this.root) {
|
||||
null -> {
|
||||
|
|
Loading…
Reference in a new issue