Feature/2099 personal state

This commit is contained in:
Arnfried Griesert
2022-06-29 11:08:57 +00:00
parent 7cdd0bf37f
commit 125e3b5362
9 changed files with 253 additions and 10 deletions
@@ -79,6 +79,7 @@ typedef NS_ENUM(NSUInteger, USER_SETTINGS_INDEX)
{
USER_SETTINGS_PROFILE_PICTURE_INDEX = 0,
USER_SETTINGS_DISPLAYNAME_INDEX,
USER_SETTINGS_PERSONAL_STATE_INDEX,
USER_SETTINGS_CHANGE_PASSWORD_INDEX,
USER_SETTINGS_FIRST_NAME_INDEX,
USER_SETTINGS_SURNAME_INDEX,
@@ -402,6 +403,7 @@ ThreadsBetaCoordinatorBridgePresenterDelegate>
Section *sectionUserSettings = [Section sectionWithTag:SECTION_TAG_USER_SETTINGS];
[sectionUserSettings addRowWithTag:USER_SETTINGS_PROFILE_PICTURE_INDEX];
[sectionUserSettings addRowWithTag:USER_SETTINGS_DISPLAYNAME_INDEX];
[sectionUserSettings addRowWithTag:USER_SETTINGS_PERSONAL_STATE_INDEX];
if (RiotSettings.shared.settingsScreenShowChangePassword)
{
[sectionUserSettings addRowWithTag:USER_SETTINGS_CHANGE_PASSWORD_INDEX];
@@ -1992,6 +1994,17 @@ ThreadsBetaCoordinatorBridgePresenterDelegate>
cell = displaynameCell;
}
else if (row == USER_SETTINGS_PERSONAL_STATE_INDEX)
{
cell = [tableView dequeueReusableCellWithIdentifier:kSettingsViewControllerPhoneBookCountryCellId];
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kSettingsViewControllerPhoneBookCountryCellId];
}
cell.textLabel.text = [VectorL10n bwiEditPersonalStateMyState];
cell.detailTextLabel.text = account.userStatusMessage;
}
else if (row == USER_SETTINGS_FIRST_NAME_INDEX)
{
MXKTableViewCellWithLabelAndTextField *firstCell = [self getLabelAndTextFieldCell:tableView forIndexPath:indexPath];
@@ -3224,6 +3237,10 @@ ThreadsBetaCoordinatorBridgePresenterDelegate>
{
[self onProfileAvatarTap:nil];
}
if (row == USER_SETTINGS_PERSONAL_STATE_INDEX)
{
[self showPersonalStateSettings];
}
else if (row == USER_SETTINGS_CHANGE_PASSWORD_INDEX)
{
[self displayPasswordAlert];
@@ -4390,6 +4407,14 @@ ThreadsBetaCoordinatorBridgePresenterDelegate>
}
}
- (void)showPersonalStateSettings
{
if (@available(iOS 14.0, *)) {
UIViewController *personalStateViewController = [PersonalStateViewController makeViewControllerWithSession:self.mainSession];
[self pushViewController:personalStateViewController];
}
}
- (void)showNotificationTimesSettings
{
if (@available(iOS 14.0, *)) {