Revert "Bring back downstream "Update room previews once we have decryption keys""

This reverts commit 0393dd51c9.

Change-Id: If0bf358a1cf7908e5c46dc598b7a42aa667fe644
This commit is contained in:
SpiritCroc 2022-06-22 12:39:43 +02:00
parent 3b6b51748e
commit 93208eb0d9
2 changed files with 1 additions and 22 deletions

View file

@ -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.extensions.tryOrNull
import org.matrix.android.sdk.api.listeners.ProgressListener
import org.matrix.android.sdk.api.logger.LoggerTag
@ -30,11 +27,6 @@ import org.matrix.android.sdk.internal.crypto.OutgoingKeyRequestManager
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.database.model.RoomSummaryEntity
import org.matrix.android.sdk.internal.database.query.where
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 org.matrix.android.sdk.internal.util.time.Clock
import timber.log.Timber
import javax.inject.Inject
@ -43,9 +35,6 @@ private val loggerTag = LoggerTag("MegolmSessionDataImporter", LoggerTag.CRYPTO)
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 outgoingKeyRequestManager: OutgoingKeyRequestManager,
private val cryptoStore: IMXCryptoStore,
private val clock: Clock,
@ -128,15 +117,6 @@ internal class MegolmSessionDataImporter @Inject constructor(private val olmDevi
Timber.tag(loggerTag.value).v("## importMegolmSessionsData : sessions import " + (t1 - t0) + " ms (" + megolmSessionsData.size + " sessions)")
// SC: Retry decrypting room previews for the room list
cryptoCoroutineScope.launch {
monarchy.awaitTransaction { realm ->
RoomSummaryEntity.where(realm).findAll().forEach { entity ->
roomSummaryUpdater.refreshLatestPreviewContent(realm, entity.roomId)
}
}
}
return ImportRoomKeysResult(totalNumbersOfKeys, totalNumbersOfImportedKeys)
}
}

View file

@ -100,8 +100,7 @@ class HomeDetailViewModel @AssistedInject constructor(
private val refreshRoomSummariesOnCryptoSessionChange = object : NewSessionListener {
override fun onNewSession(roomId: String?, senderKey: String, sessionId: String) {
// SC: we're doing this directly in MegolmSessionDataImporter
//session.roomService().refreshJoinedRoomSummaryPreviews(roomId)
session.roomService().refreshJoinedRoomSummaryPreviews(roomId)
}
}