Merge branch 'develop' into feature/bma/scroll-to-unread-messages

This commit is contained in:
Benoit Marty
2026-06-16 14:28:44 +02:00
committed by GitHub
382 changed files with 2538 additions and 1947 deletions
@@ -15,6 +15,7 @@ sealed class ClientException(message: String, val details: String?, cause: Throw
details = details,
cause = cause
)
class ContentScanner(message: String, val reason: ContentScannerErrorReason) : ClientException(message, null, null)
class Other(message: String, cause: Throwable? = null) : ClientException(message, null, cause)
}
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.matrix.api.exception
enum class ContentScannerErrorReason {
MCS_MALFORMED_JSON,
MCS_MEDIA_FAILED_TO_DECRYPT,
M_MISSING_TOKEN,
M_UNKNOWN_TOKEN,
M_NOT_FOUND,
MCS_MEDIA_NOT_CLEAN,
MCS_MIME_TYPE_FORBIDDEN,
MCS_BAD_DECRYPTION,
M_UNKNOWN,
MCS_MEDIA_REQUEST_FAILED;
companion object;
fun isDangerous(): Boolean = when (this) {
MCS_MEDIA_NOT_CLEAN, MCS_MIME_TYPE_FORBIDDEN -> true
else -> false
}
}