mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +03:00
Merge pull request #4848 from vector-im/cgizard/translate_error_message_joining_room
Update error message when joining room
This commit is contained in:
commit
ed00f9f712
3 changed files with 6 additions and 0 deletions
1
changelog.d/4847.bugfix
Normal file
1
changelog.d/4847.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Translate the error observed when the user is not allowed to join a room
|
|
@ -100,6 +100,10 @@ class DefaultErrorFormatter @Inject constructor(
|
|||
throwable.error.code == MatrixError.M_THREEPID_AUTH_FAILED -> {
|
||||
stringProvider.getString(R.string.error_threepid_auth_failed)
|
||||
}
|
||||
throwable.error.code == MatrixError.M_UNKNOWN &&
|
||||
throwable.error.message == "Not allowed to join this room" -> {
|
||||
stringProvider.getString(R.string.room_error_access_unauthorized)
|
||||
}
|
||||
else -> {
|
||||
throwable.error.message.takeIf { it.isNotEmpty() }
|
||||
?: throwable.error.code.takeIf { it.isNotEmpty() }
|
||||
|
|
|
@ -169,6 +169,7 @@
|
|||
|
||||
<!-- room error messages -->
|
||||
<string name="room_error_join_failed_empty_room">It is not currently possible to re-join an empty room.</string>
|
||||
<string name="room_error_access_unauthorized">You are not allowed to join this room</string>
|
||||
|
||||
<!-- medium friendly name -->
|
||||
<string name="medium_email">Email address</string>
|
||||
|
|
Loading…
Reference in a new issue