From c6bd6c17fceb4e79ac2788d361635f6d810f7bcd Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 1 Sep 2020 14:55:12 +0200 Subject: [PATCH] Auto review --- CHANGES.md | 2 +- .../matrix/android/sdk/api/session/profile/ProfileService.kt | 4 ++-- .../src/main/java/im/vector/app/core/error/ErrorFormatter.kt | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9bd7a8be6b..93311f1860 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ Changes in Element 1.0.6 (2020-XX-XX) =================================================== Features ✨: - - List phone numbers and emails added to the Matrix account, and add Email adn phone numbers to account (#44, #45) + - List phone numbers and emails added to the Matrix account, and add emails and phone numbers to account (#44, #45) Improvements 🙌: - You can now join room through permalink and within room directory search diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt index 8742c9e7d0..15066cc4a6 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt @@ -113,13 +113,13 @@ interface ProfileService { matrixCallback: MatrixCallback): Cancelable /** - * Cancel adding a threepid. It will remove data store locally about this ThreePid + * Cancel adding a threepid. It will remove locally stored data about this ThreePid */ fun cancelAddingThreePid(threePid: ThreePid, matrixCallback: MatrixCallback): Cancelable /** - * Delete a 3Pids. + * Remove a 3Pid from the Matrix account. */ fun deleteThreePid(threePid: ThreePid, matrixCallback: MatrixCallback): Cancelable } diff --git a/vector/src/main/java/im/vector/app/core/error/ErrorFormatter.kt b/vector/src/main/java/im/vector/app/core/error/ErrorFormatter.kt index f6c251ddd7..43395b97f7 100644 --- a/vector/src/main/java/im/vector/app/core/error/ErrorFormatter.kt +++ b/vector/src/main/java/im/vector/app/core/error/ErrorFormatter.kt @@ -91,6 +91,10 @@ class DefaultErrorFormatter @Inject constructor( && throwable.error.message == "Email is already in use" -> { stringProvider.getString(R.string.account_email_already_used_error) } + throwable.error.code == MatrixError.M_THREEPID_IN_USE + && throwable.error.message == "MSISDN is already in use" -> { + stringProvider.getString(R.string.account_phone_number_already_used_error) + } throwable.error.code == MatrixError.M_THREEPID_AUTH_FAILED -> { stringProvider.getString(R.string.error_threepid_auth_failed) }