From 2bdaecbb020305674444356e32803de858fc3978 Mon Sep 17 00:00:00 2001 From: Nicolas Buquet Date: Mon, 30 Oct 2023 18:06:16 +0100 Subject: [PATCH] =?UTF-8?q?Message=20d'erreur=20en=20FR=20lors=20de=20l'?= =?UTF-8?q?=C3=A9chec=20d'invitation=20dans=20un=20salon=20d'un=20externe?= =?UTF-8?q?=20non=20pr=C3=A9sent=20dans=20l'annuaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContactsPicker/ContactsPickerViewModel.swift | 9 ++++++++- changelog.d/908.change | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 changelog.d/908.change diff --git a/Riot/Modules/Room/ParticipantsInviteModal/ContactsPicker/ContactsPickerViewModel.swift b/Riot/Modules/Room/ParticipantsInviteModal/ContactsPicker/ContactsPickerViewModel.swift index aa1eb92ad7..ba73bea30f 100644 --- a/Riot/Modules/Room/ParticipantsInviteModal/ContactsPicker/ContactsPickerViewModel.swift +++ b/Riot/Modules/Room/ParticipantsInviteModal/ContactsPicker/ContactsPickerViewModel.swift @@ -291,7 +291,14 @@ extension ContactsPickerViewModel: ContactsTableViewControllerDelegate { if let error = response.error as NSError?, error.domain == kMXRestClientErrorDomain, error.code == MXRestClientErrorMissingIdentityServer { self.coordinatorDelegate?.contactsPickerViewModel(self, inviteFailedWithError: nil) AppDelegate.theDelegate().showAlert(withTitle: VectorL10n.errorInvite3pidWithNoIdentityServer, message: nil) - } else { + } + // Tchap: make error message clearer and in french when a member can't be invited to a room + else if let mxError = MXError(nsError: response.error), + mxError.errcode == kMXErrCodeStringForbidden, + let tchapErrorCannotInvite = MXError(errorCode: mxError.errcode, error: TchapL10n.roomInviteErrorActionForbidden, userInfo: mxError.userInfo) { + self.coordinatorDelegate?.contactsPickerViewModel(self, inviteFailedWithError: tchapErrorCannotInvite.createNSError()) + } + else { self.coordinatorDelegate?.contactsPickerViewModel(self, inviteFailedWithError: response.error) } } diff --git a/changelog.d/908.change b/changelog.d/908.change new file mode 100644 index 0000000000..73b6c94097 --- /dev/null +++ b/changelog.d/908.change @@ -0,0 +1 @@ +Message d'erreur en FR lors de l'échec d'invitation dans un salon d'un externe non présent dans l'annuaire \ No newline at end of file