mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Merge pull request #7656 from vector-im/mauroromito/account_management_cell_for_oidc
Manage account through MAS if available
This commit is contained in:
@@ -50,6 +50,7 @@ typedef NS_ENUM(NSUInteger, SECTION_TAG)
|
||||
{
|
||||
SECTION_TAG_SIGN_OUT = 0,
|
||||
SECTION_TAG_USER_SETTINGS,
|
||||
SECTION_TAG_ACCOUNT,
|
||||
SECTION_TAG_SENDING_MEDIA,
|
||||
SECTION_TAG_LINKS,
|
||||
SECTION_TAG_SECURITY,
|
||||
@@ -185,6 +186,11 @@ typedef NS_ENUM(NSUInteger, SECURITY)
|
||||
DEVICE_MANAGER_INDEX
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSUInteger, ACCOUNT)
|
||||
{
|
||||
ACCOUNT_MANAGE_INDEX = 0,
|
||||
};
|
||||
|
||||
typedef void (^blockSettingsViewController_onReadyToDestroy)(void);
|
||||
|
||||
#pragma mark - SettingsViewController
|
||||
@@ -386,6 +392,16 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
|
||||
sectionUserSettings.headerTitle = [VectorL10n settingsUserSettings];
|
||||
[tmpSections addObject:sectionUserSettings];
|
||||
|
||||
NSString *manageAccountURL = self.mainSession.homeserverWellknown.authentication.account;
|
||||
if (manageAccountURL)
|
||||
{
|
||||
Section *account = [Section sectionWithTag: SECTION_TAG_ACCOUNT];
|
||||
[account addRowWithTag:ACCOUNT_MANAGE_INDEX];
|
||||
account.headerTitle = [VectorL10n settingsManageAccountTitle];
|
||||
account.footerTitle = [VectorL10n settingsManageAccountDescription:manageAccountURL];
|
||||
[tmpSections addObject:account];
|
||||
}
|
||||
|
||||
if (BuildSettings.settingsScreenShowConfirmMediaSize)
|
||||
{
|
||||
@@ -2629,6 +2645,17 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
|
||||
cell = deactivateAccountBtnCell;
|
||||
}
|
||||
else if (section == SECTION_TAG_ACCOUNT)
|
||||
{
|
||||
switch (row)
|
||||
{
|
||||
case ACCOUNT_MANAGE_INDEX:
|
||||
cell = [self getDefaultTableViewCell:tableView];
|
||||
cell.textLabel.text = [VectorL10n settingsManageAccountAction];
|
||||
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return cell;
|
||||
}
|
||||
@@ -2978,6 +3005,14 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (section == SECTION_TAG_ACCOUNT)
|
||||
{
|
||||
switch(row) {
|
||||
case ACCOUNT_MANAGE_INDEX:
|
||||
[self onManageAccountTap];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}
|
||||
@@ -3886,6 +3921,14 @@ ChangePasswordCoordinatorBridgePresenterDelegate>
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onManageAccountTap
|
||||
{
|
||||
NSURL *url = [NSURL URLWithString: self.mainSession.homeserverWellknown.authentication.account];
|
||||
if (url) {
|
||||
[UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showThemePicker
|
||||
{
|
||||
__weak typeof(self) weakSelf = self;
|
||||
|
||||
Reference in New Issue
Block a user