Skip to content

Commit

Permalink
Merge pull request #712 from tchapgouv/phlpro/710-change-password
Browse files Browse the repository at this point in the history
Fix password update management in Tchap Settings screen
  • Loading branch information
Phl-Pro authored Jan 23, 2023
2 parents e34bce8 + 3a87791 commit ed8eb46
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 129 deletions.
24 changes: 12 additions & 12 deletions Riot/Modules/Settings/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,6 @@ @interface SettingsViewController () <UITextFieldDelegate, MXKCountryPickerViewC

@property (nonatomic) AnalyticsScreenTracker *screenTracker;

// Tchap: Customize Password change
#ifdef SECURE_BACKUP
@property (nonatomic, strong) ChangePasswordAlertPresenter *changePasswordAlertPresenter;
#endif
@property (strong, nonatomic) ChangePasswordCoordinatorBridgePresenter *changePasswordPresenter;

@property (nonatomic, strong) MXKDocumentPickerPresenter *documentPickerPresenter;
Expand Down Expand Up @@ -4347,14 +4343,8 @@ - (BOOL)textFieldShouldReturn:(UITextField *)textField

- (void)promptUserBeforePasswordChange
{
#ifdef SECURE_BACKUP
MXKeyBackup *keyBackup = self.mainSession.crypto.backup;

[self.changePasswordAlertPresenter presentFor:keyBackup.state
areThereKeysToBackup:keyBackup.hasKeysToBackup
from:self
sourceView:self.tableView
animated:YES];
#ifndef SECURE_BACKUP
[self displayPasswordAlert];
#else
MXWeakify(self);
[resetPwdAlertController dismissViewControllerAnimated:NO completion:nil];
Expand Down Expand Up @@ -4431,6 +4421,16 @@ - (nullable NSString *)detailedMessageOnPasswordUpdateFailure:(NSError *)error
return message;
}

#pragma password update management

- (void)displayPasswordAlert
{
self.changePasswordBridgePresenter = [[ChangePasswordCoordinatorBridgePresenter alloc] initWithSession:self.mainSession];
self.changePasswordBridgePresenter.delegate = self;

[self.changePasswordBridgePresenter presentFrom:self animated:YES];
}

#pragma mark - MXKCountryPickerViewControllerDelegate

- (void)countryPickerViewController:(MXKCountryPickerViewController *)countryPickerViewController didSelectCountry:(NSString *)isoCountryCode
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/710.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix password update management in Tchap Settings screen

0 comments on commit ed8eb46

Please sign in to comment.