Fix: renamed parameter for code clarity

This commit is contained in:
Nicolas Mauri 2023-06-06 09:55:33 +02:00
parent e848158db4
commit ee63d417d3

View file

@ -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