mirror of
https://github.com/vector-im/riotX-android
synced 2025-10-06 00:02:48 +02:00
Update error message when joining room
This commit is contained in:
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>
|
||||
|
Reference in New Issue
Block a user