Merge pull request #5091 from vector-im/steve/5090_update_settings_about_section

Settings: Update about section footer text
This commit is contained in:
SBiOSoftWhare
2021-11-04 12:02:10 +01:00
committed by GitHub
2 changed files with 32 additions and 7 deletions
+31 -7
View File
@@ -541,13 +541,8 @@ TableViewSectionsDelegate>
sectionAbout.headerTitle = VectorL10n.settingsAbout;
if (BuildSettings.settingsScreenShowAdvancedSettings)
{
sectionAbout.footerTitle = [NSString stringWithFormat:@"Element %@ (%@) / Olm %@\n%@\n%@",
AppInfo.current.appVersion.bundleShortVersion,
AppInfo.current.appVersion.bundleVersion,
[OLMKit versionString],
[MatrixKitL10n settingsConfigUserId:account.mxCredentials.userId],
[MatrixKitL10n settingsConfigHomeServer:account.mxCredentials.homeServer]];
{
sectionAbout.footerTitle = [self buildAboutSectionFooterTitleWithAccount:account];
}
[tmpSections addObject:sectionAbout];
@@ -1425,6 +1420,35 @@ TableViewSectionsDelegate>
}
}
- (NSString*)buildAboutSectionFooterTitleWithAccount:(MXKAccount*)account
{
NSMutableString *footerText = [NSMutableString new];
AppInfo *appInfo = AppInfo.current;
NSString *appName = appInfo.displayName;
NSString *appVersion = appInfo.appVersion.bundleShortVersion;
NSString *buildVersion = appInfo.appVersion.bundleVersion;
NSString *appVersionInfo = [NSString stringWithFormat:@"%@ %@ (%@)", appName, appVersion, buildVersion];
NSString *loggedUserInfo = [MatrixKitL10n settingsConfigUserId:account.mxCredentials.userId];
NSString *homeserverInfo = [MatrixKitL10n settingsConfigHomeServer:account.mxCredentials.homeServer];
NSString *sdkVersionInfo = [NSString stringWithFormat:@"Matrix SDK %@", MatrixSDKVersion];
NSString *olmVersionInfo = [NSString stringWithFormat:@"OLM %@", [OLMKit versionString]];
[footerText appendFormat:@"%@\n", loggedUserInfo];
[footerText appendFormat:@"%@\n", homeserverInfo];
[footerText appendFormat:@"%@\n", appVersionInfo];
[footerText appendFormat:@"%@\n", sdkVersionInfo];
[footerText appendFormat:@"%@", olmVersionInfo];
return [footerText copy];
}
#pragma mark - 3Pid Add
- (void)showAuthenticationIfNeededForAdding:(MX3PIDMedium)medium withSession:(MXSession*)session completion:(void (^)(NSDictionary* authParams))completion