mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 09:02:44 +02:00
Feature/2854 version management
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user