diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/contentscanner/tasks/ScanEncryptedTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/contentscanner/tasks/ScanEncryptedTask.kt index b3f4645abc..4550d12f30 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/contentscanner/tasks/ScanEncryptedTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/contentscanner/tasks/ScanEncryptedTask.kt @@ -42,12 +42,10 @@ internal class DefaultScanEncryptedTask @Inject constructor( override suspend fun execute(params: ScanEncryptedTask.Params): ScanResponse { val mxcUrl = params.mxcUrl - val scannerUrl = contentScannerStore.getScannerUrl() - contentScannerStore.updateStateForContent(params.mxcUrl, ScanState.IN_PROGRESS, scannerUrl) - + contentScannerStore.updateStateForContent(mxcUrl, ScanState.IN_PROGRESS, scannerUrl) try { - val dlBody = ScanEncryptorUtils.getDownloadBodyAndEncryptIfNeeded(params.publicServerKey, params.mxcUrl, params.encryptedInfo) + val dlBody = ScanEncryptorUtils.getDownloadBodyAndEncryptIfNeeded(params.publicServerKey, mxcUrl, params.encryptedInfo) val api = contentScannerApiProvider.contentScannerApi ?: throw IllegalArgumentException() val executeRequest = executeRequest(null) { api.scanFile(dlBody) @@ -60,7 +58,7 @@ internal class DefaultScanEncryptedTask @Inject constructor( ) return executeRequest } catch (failure: Throwable) { - contentScannerStore.updateStateForContent(params.mxcUrl, ScanState.UNKNOWN, scannerUrl) + contentScannerStore.updateStateForContent(mxcUrl, ScanState.UNKNOWN, scannerUrl) throw failure.toScanFailure() ?: failure } }