diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt index e466def1a1..d405bdce27 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/crosssigning/DefaultCrossSigningService.kt @@ -779,6 +779,11 @@ internal class DefaultCrossSigningService @Inject constructor( override fun onUsersDeviceUpdate(userIds: List) { Timber.d("## CrossSigning - onUsersDeviceUpdate for users: ${userIds.logLimit()}") + checkTrustAndAffectedRoomShields(userIds) + } + + fun checkTrustAndAffectedRoomShields(userIds: List) { + Timber.d("## CrossSigning - checkTrustAndAffectedRoomShields for users: ${userIds.logLimit()}") val workerParams = UpdateTrustWorker.Params( sessionId = sessionId, filename = updateTrustWorkerDataRepository.createParam(userIds) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryUpdater.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryUpdater.kt index 33ca0ca777..6979d42827 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryUpdater.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/summary/RoomSummaryUpdater.kt @@ -185,10 +185,10 @@ internal class RoomSummaryUpdater @Inject constructor( if (aggregator == null) { // Do it now // mmm maybe we could only refresh shield instead of checking trust also? - crossSigningService.onUsersDeviceUpdate(otherRoomMembers) + crossSigningService.checkTrustAndAffectedRoomShields(otherRoomMembers) } else { // Schedule it - aggregator.userIdsWithDeviceUpdate.addAll(otherRoomMembers) + aggregator.userIdsForCheckingTrustAndAffectedRoomShields.addAll(otherRoomMembers) } } } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncResponsePostTreatmentAggregator.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncResponsePostTreatmentAggregator.kt index ab6907d9e8..2b7f936fa8 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncResponsePostTreatmentAggregator.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/SyncResponsePostTreatmentAggregator.kt @@ -26,6 +26,6 @@ internal class SyncResponsePostTreatmentAggregator { // Set of userIds to fetch and update at the end of incremental syncs val userIdsToFetch = mutableSetOf() - // Set of users to call `crossSigningService.onUsersDeviceUpdate` once per sync - val userIdsWithDeviceUpdate = mutableSetOf() + // Set of users to call `crossSigningService.checkTrustAndAffectedRoomShields` once per sync + val userIdsForCheckingTrustAndAffectedRoomShields = mutableSetOf() } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/handler/SyncResponsePostTreatmentAggregatorHandler.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/handler/SyncResponsePostTreatmentAggregatorHandler.kt index 2d8339c901..c749f77fff 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/handler/SyncResponsePostTreatmentAggregatorHandler.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/handler/SyncResponsePostTreatmentAggregatorHandler.kt @@ -48,7 +48,7 @@ internal class SyncResponsePostTreatmentAggregatorHandler @Inject constructor( cleanupEphemeralFiles(aggregator.ephemeralFilesToDelete) updateDirectUserIds(aggregator.directChatsToCheck) fetchAndUpdateUsers(aggregator.userIdsToFetch) - handleUserIdsWithDeviceUpdate(aggregator.userIdsWithDeviceUpdate) + handleUserIdsForCheckingTrustAndAffectedRoomShields(aggregator.userIdsForCheckingTrustAndAffectedRoomShields) } private fun cleanupEphemeralFiles(ephemeralFilesToDelete: List) { @@ -105,7 +105,7 @@ internal class SyncResponsePostTreatmentAggregatorHandler @Inject constructor( .enqueue() } - private fun handleUserIdsWithDeviceUpdate(userIdsWithDeviceUpdate: Iterable) { - crossSigningService.onUsersDeviceUpdate(userIdsWithDeviceUpdate.toList()) + private fun handleUserIdsForCheckingTrustAndAffectedRoomShields(userIdsWithDeviceUpdate: Iterable) { + crossSigningService.checkTrustAndAffectedRoomShields(userIdsWithDeviceUpdate.toList()) } }