Skip to content

Commit

Permalink
Invitations : forcer l'email en minuscules à l'envoi d'invitation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Buquet committed May 6, 2024
1 parent 4d968a2 commit 13cc76f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class ContactsPickerViewModel: NSObject, ContactsPickerViewModelProtocol {
contactsViewController.showSearch(true)
// Tchap: Replace string by removing user ID
contactsViewController.searchBar.placeholder = VectorL10n.roomParticipantsInviteAnotherUserWithoutId
// Tchap: don't force capitalization of first char of search input (to protect capitalization of email)
// when inviting a participant in a room.
contactsViewController.searchBar.searchTextField.autocapitalizationType = .none
// Tchap: don't make searchbar resign as first responder.
// Let it becomes first responder to activate the input field and deploy the keyboard when the controller comes to screen.
// contactsViewController.searchBar.resignFirstResponder()
Expand Down Expand Up @@ -279,7 +282,9 @@ extension ContactsPickerViewModel: ContactsTableViewControllerDelegate {
self.coordinatorDelegate?.contactsPickerViewModelDidStartInvite(self)
// Is it an email or a Matrix user ID?
if MXTools.isEmailAddress(participantId) {
room.invite(.email(participantId)) { [weak self] response in
// Tchap: be sure to convert email address to lowercase.
// room.invite(.email(participantId)) { [weak self] response in
room.invite(.email(participantId.lowercased())) { [weak self] response in
guard let self = self else { return }

switch response {
Expand Down
4 changes: 3 additions & 1 deletion Riot/Modules/StartChat/StartChatViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,9 @@ - (IBAction)onButtonPressed:(id)sender
MXInvite3PID *invite3PID = [[MXInvite3PID alloc] init];
invite3PID.identityServer = identityServer;
invite3PID.medium = kMX3PIDMediumEmail;
invite3PID.address = participantId;
// Tchap: be sure to convert email address to lowercase
// invite3PID.address = participantId;
invite3PID.address = participantId.lowercaseString;

[invite3PIDArray addObject:invite3PID];
}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/1024.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
forcer l'email en minuscules à l'envoi d'invitation à un salon (pour éviter les problèmes d'email avec majuscules)

0 comments on commit 13cc76f

Please sign in to comment.