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