From 1f9b9571fd46e51e2b25d022dcb422419ea1fc67 Mon Sep 17 00:00:00 2001 From: ariskotsomitopoulos Date: Wed, 27 Apr 2022 12:42:23 +0300 Subject: [PATCH] Enhance code format --- .../features/analytics/DecryptionFailureTracker.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/analytics/DecryptionFailureTracker.kt b/vector/src/main/java/im/vector/app/features/analytics/DecryptionFailureTracker.kt index b23365c056..ec34ff7421 100644 --- a/vector/src/main/java/im/vector/app/features/analytics/DecryptionFailureTracker.kt +++ b/vector/src/main/java/im/vector/app/features/analytics/DecryptionFailureTracker.kt @@ -145,12 +145,13 @@ class DecryptionFailureTracker @Inject constructor( private fun MXCryptoError.ErrorType.toAnalyticsErrorName(): DetailedErrorName { val detailed = "$name | mxc_crypto_error_type" - return when (this) { + val errorName = when (this) { MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID, - MXCryptoError.ErrorType.KEYS_WITHHELD -> Pair(detailed, Error.Name.OlmKeysNotSentError) - MXCryptoError.ErrorType.OLM -> Pair(detailed, Error.Name.OlmUnspecifiedError) - MXCryptoError.ErrorType.UNKNOWN_MESSAGE_INDEX -> Pair(detailed, Error.Name.OlmIndexError) - else -> Pair(detailed, Error.Name.UnknownError) + MXCryptoError.ErrorType.KEYS_WITHHELD -> Error.Name.OlmKeysNotSentError + MXCryptoError.ErrorType.OLM -> Error.Name.OlmUnspecifiedError + MXCryptoError.ErrorType.UNKNOWN_MESSAGE_INDEX -> Error.Name.OlmIndexError + else -> Error.Name.UnknownError } + return DetailedErrorName(detailed, errorName) } }