diff --git a/Riot/Modules/Room/ParticipantsInviteModal/ContactsPicker/ContactsPickerViewModel.swift b/Riot/Modules/Room/ParticipantsInviteModal/ContactsPicker/ContactsPickerViewModel.swift index a2e74edc7..f919a9037 100644 --- a/Riot/Modules/Room/ParticipantsInviteModal/ContactsPicker/ContactsPickerViewModel.swift +++ b/Riot/Modules/Room/ParticipantsInviteModal/ContactsPicker/ContactsPickerViewModel.swift @@ -212,17 +212,17 @@ extension ContactsPickerViewModel: ContactsTableViewControllerDelegate { }, failure: { [weak self] error in guard let self = self else { return } self.coordinatorDelegate?.contactsPickerViewModelDidEndValidatingUser(self) - self.displayInvitePrompt(contact: contact, contactFound: false) + self.displayInvitePrompt(contact: contact, isUnknownUser: true) }) } else { displayInvitePrompt(contact: contact) } } - private func displayInvitePrompt(contact: MXKContact, contactFound: Bool = true) { + private func displayInvitePrompt(contact: MXKContact, isUnknownUser: Bool = false) { let roomName = room.displayName ?? VectorL10n.spaceTag - let message = contactFound ? VectorL10n.roomParticipantsInvitePromptToMsg(contact.displayName, roomName) : VectorL10n.roomParticipantsInviteUnknownParticipantPromptToMsg(contact.displayName, roomName) - let inviteActionTitle = contactFound ? VectorL10n.invite : VectorL10n.roomParticipantsInviteAnyway + let message = isUnknownUser ? VectorL10n.roomParticipantsInviteUnknownParticipantPromptToMsg(contact.displayName, roomName) : VectorL10n.roomParticipantsInvitePromptToMsg(contact.displayName, roomName) + let inviteActionTitle = isUnknownUser ? VectorL10n.roomParticipantsInviteAnyway : VectorL10n.invite coordinatorDelegate?.contactsPickerViewModel(self, display: message, title: VectorL10n.roomParticipantsInvitePromptTitle, actions: [ UIAlertAction(title: VectorL10n.cancel, style: .cancel), UIAlertAction(title: VectorL10n.invite, style: .default, handler: { [weak self] _ in