Feature/2854 version management

This commit is contained in:
Frank Rotermund
2022-07-26 15:07:22 +00:00
parent 42b593e077
commit 41d31a5375
57 changed files with 203 additions and 36 deletions
+31 -2
View File
@@ -72,6 +72,7 @@ typedef NS_ENUM(NSUInteger, SECTION_TAG)
SECTION_TAG_FLAIR,
SECTION_TAG_DEACTIVATE_ACCOUNT,
SECTION_TAG_DOWNTIME_WARNING,
SECTION_TAG_OUTDATED_WARNING,
SECTION_TAG_DEVELOPER
};
@@ -224,6 +225,11 @@ enum
DOWNTIME_WARNING = 0
};
enum
{
OUTDATED_WARNING = 0
};
typedef void (^blockSettingsViewController_onReadyToDestroy)(void);
#pragma mark - SettingsViewController
@@ -392,7 +398,7 @@ ThreadsBetaCoordinatorBridgePresenterDelegate>
- (void)updateSections
{
NSMutableArray<Section*> *tmpSections = [NSMutableArray arrayWithCapacity:SECTION_TAG_DOWNTIME_WARNING + 1];
NSMutableArray<Section*> *tmpSections = [NSMutableArray arrayWithCapacity:SECTION_TAG_DEVELOPER + 1];
if ( [[[ServerDowntimeDefaultService alloc] init] isDowntimePresentable]) {
Section *sectionDowntime = [Section sectionWithTag:SECTION_TAG_DOWNTIME_WARNING];
@@ -400,6 +406,13 @@ ThreadsBetaCoordinatorBridgePresenterDelegate>
[tmpSections addObject:sectionDowntime];
}
if (BwiBuildSettings.bwiCheckAppVersion && [[[ValidAppVersionsDefaultService alloc] init] isCurrentAppVersionOutdated]) {
Section *sectionOutdated = [Section sectionWithTag:SECTION_TAG_OUTDATED_WARNING];
[sectionOutdated addRowWithTag:OUTDATED_WARNING];
sectionOutdated.headerTitle = [VectorL10n bwiOutdatedSettingsHeader];
[tmpSections addObject:sectionOutdated];
}
Section *sectionUserSettings = [Section sectionWithTag:SECTION_TAG_USER_SETTINGS];
[sectionUserSettings addRowWithTag:USER_SETTINGS_PROFILE_PICTURE_INDEX];
[sectionUserSettings addRowWithTag:USER_SETTINGS_DISPLAYNAME_INDEX];
@@ -698,7 +711,7 @@ ThreadsBetaCoordinatorBridgePresenterDelegate>
[sectionAbout addRowWithTag:ABOUT_MARK_ALL_AS_READ_INDEX];
[sectionAbout addRowWithTag:ABOUT_CLEAR_CACHE_INDEX];
if (BuildSettings.bwiShowDeveloperSettings && @available(iOS 14.0, *)) {
if (BuildSettings.bwiShowDeveloperSettings) {
Section *sectionDeveloper = [Section sectionWithTag:SECTION_TAG_DEVELOPER];
[sectionDeveloper addRowWithTag:DEVELOPER_SHOW_SETTINGS_INDEX];
sectionDeveloper.headerTitle = NSLocalizedStringFromTable(@"bwi_settings_developer", @"Vector", nil).uppercaseString;
@@ -2924,6 +2937,22 @@ ThreadsBetaCoordinatorBridgePresenterDelegate>
cell = downtimeCell;
}
}
else if (section == SECTION_TAG_OUTDATED_WARNING)
{
if (row == OUTDATED_WARNING)
{
MXKTableViewCell *downtimeCell = [self getWarningTableViewCell:tableView];
downtimeCell.contentView.backgroundColor = [UIColor yellowColor];
downtimeCell.textLabel.text = [VectorL10n bwiOutdatedSettingsMessage:AppInfo.current.displayName];
downtimeCell.textLabel.textColor = [UIColor blackColor];
downtimeCell.textLabel.lineBreakMode = NSLineBreakByWordWrapping;
downtimeCell.textLabel.numberOfLines = 5;
cell = downtimeCell;
}
}
else if (section == SECTION_TAG_DEVELOPER)
{
if (row == DEVELOPER_SHOW_SETTINGS_INDEX)