diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 132e5dd25..1856fdb9f 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -748,6 +748,9 @@ Tap the + to start adding people."; "settings_three_pids_management_information_part1" = "Manage which email addresses or phone numbers you can use to log in or recover your account here. Control who can find you in "; "settings_three_pids_management_information_part2" = "Discovery"; "settings_three_pids_management_information_part3" = "."; +"settings_manage_account_title" = "Account"; +"settings_manage_account_action" = "Manage"; +"settings_manage_account_description" = "Manage your account at %@"; "settings_confirm_media_size" = "Confirm size when sending"; "settings_confirm_media_size_description" = "When this is on, you’ll be asked to confirm what size images and videos will be sent as."; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 1c2516fe9..cc34c01bb 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -7791,6 +7791,18 @@ public class VectorL10n: NSObject { public static var settingsLinks: String { return VectorL10n.tr("Vector", "settings_links") } + /// Manage + public static var settingsManageAccountAction: String { + return VectorL10n.tr("Vector", "settings_manage_account_action") + } + /// Manage your account at %@ + public static func settingsManageAccountDescription(_ p1: String) -> String { + return VectorL10n.tr("Vector", "settings_manage_account_description", p1) + } + /// Account + public static var settingsManageAccountTitle: String { + return VectorL10n.tr("Vector", "settings_manage_account_title") + } /// Mark all messages as read public static var settingsMarkAllAsRead: String { return VectorL10n.tr("Vector", "settings_mark_all_as_read") diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index be87bea3b..86aec19e8 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -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 @@ -383,6 +389,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) { @@ -2626,6 +2642,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; } @@ -2975,6 +3002,14 @@ ChangePasswordCoordinatorBridgePresenterDelegate> break; } } + else if (section == SECTION_TAG_ACCOUNT) + { + switch(row) { + case ACCOUNT_MANAGE_INDEX: + [self onManageAccountTap]; + break; + } + } [tableView deselectRowAtIndexPath:indexPath animated:YES]; } @@ -3883,6 +3918,12 @@ ChangePasswordCoordinatorBridgePresenterDelegate> } } +- (void)onManageAccountTap +{ + // TODO + // Open a web view with the account url +} + - (void)showThemePicker { __weak typeof(self) weakSelf = self;