@@ -50,6 +50,7 @@ typedef NS_ENUM(NSUInteger, SECTION_TAG)
5050{
5151 SECTION_TAG_SIGN_OUT = 0 ,
5252 SECTION_TAG_USER_SETTINGS,
53+ SECTION_TAG_ACCOUNT,
5354 SECTION_TAG_SENDING_MEDIA,
5455 SECTION_TAG_LINKS,
5556 SECTION_TAG_SECURITY,
@@ -185,6 +186,11 @@ typedef NS_ENUM(NSUInteger, SECURITY)
185186 DEVICE_MANAGER_INDEX
186187};
187188
189+ typedef NS_ENUM (NSUInteger , ACCOUNT)
190+ {
191+ ACCOUNT_MANAGE_INDEX = 0 ,
192+ };
193+
188194typedef void (^blockSettingsViewController_onReadyToDestroy)(void );
189195
190196#pragma mark - SettingsViewController
@@ -365,7 +371,10 @@ - (void)updateSections
365371 {
366372 [sectionUserSettings addRowWithTag: USER_SETTINGS_PHONENUMBERS_OFFSET + index];
367373 }
368- if (BuildSettings.settingsScreenAllowAddingEmailThreepids )
374+ if (BuildSettings.settingsScreenAllowAddingEmailThreepids &&
375+ // If the threePidChanges is nil we assume the capability to be true
376+ (!self.mainSession .homeserverCapabilities .threePidChanges ||
377+ self.mainSession .homeserverCapabilities .threePidChanges .enabled ))
369378 {
370379 [sectionUserSettings addRowWithTag: USER_SETTINGS_ADD_EMAIL_INDEX];
371380 }
@@ -383,6 +392,16 @@ - (void)updateSections
383392
384393 sectionUserSettings.headerTitle = [VectorL10n settingsUserSettings ];
385394 [tmpSections addObject: sectionUserSettings];
395+
396+ NSString *manageAccountURL = self.mainSession .homeserverWellknown .authentication .account ;
397+ if (manageAccountURL)
398+ {
399+ Section *account = [Section sectionWithTag: SECTION_TAG_ACCOUNT];
400+ [account addRowWithTag: ACCOUNT_MANAGE_INDEX];
401+ account.headerTitle = [VectorL10n settingsManageAccountTitle ];
402+ account.footerTitle = [VectorL10n settingsManageAccountDescription: manageAccountURL];
403+ [tmpSections addObject: account];
404+ }
386405
387406 if (BuildSettings.settingsScreenShowConfirmMediaSize )
388407 {
@@ -608,7 +627,7 @@ - (void)updateSections
608627 }
609628 }
610629
611- if (BuildSettings.settingsScreenAllowDeactivatingAccount )
630+ if (BuildSettings.settingsScreenAllowDeactivatingAccount && !self. mainSession . homeserverWellknown . authentication )
612631 {
613632 Section *sectionDeactivate = [Section sectionWithTag: SECTION_TAG_DEACTIVATE_ACCOUNT];
614633 [sectionDeactivate addRowWithTag: 0 ];
@@ -2626,6 +2645,17 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
26262645
26272646 cell = deactivateAccountBtnCell;
26282647 }
2648+ else if (section == SECTION_TAG_ACCOUNT)
2649+ {
2650+ switch (row)
2651+ {
2652+ case ACCOUNT_MANAGE_INDEX:
2653+ cell = [self getDefaultTableViewCell: tableView];
2654+ cell.textLabel .text = [VectorL10n settingsManageAccountAction ];
2655+ [cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme ];
2656+ break ;
2657+ }
2658+ }
26292659
26302660 return cell;
26312661}
@@ -2975,6 +3005,14 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
29753005 break ;
29763006 }
29773007 }
3008+ else if (section == SECTION_TAG_ACCOUNT)
3009+ {
3010+ switch (row) {
3011+ case ACCOUNT_MANAGE_INDEX:
3012+ [self onManageAccountTap ];
3013+ break ;
3014+ }
3015+ }
29783016
29793017 [tableView deselectRowAtIndexPath: indexPath animated: YES ];
29803018 }
@@ -3883,6 +3921,14 @@ - (void)onProfileAvatarTap:(UITapGestureRecognizer *)recognizer
38833921 }
38843922}
38853923
3924+ - (void )onManageAccountTap
3925+ {
3926+ NSURL *url = [NSURL URLWithString: self .mainSession.homeserverWellknown.authentication.account];
3927+ if (url) {
3928+ [UIApplication.sharedApplication openURL: url options: @{} completionHandler: nil ];
3929+ }
3930+ }
3931+
38863932- (void )showThemePicker
38873933{
38883934 __weak typeof (self) weakSelf = self;
0 commit comments