diff --git a/NextcloudTalk/NCDatabaseManager.m b/NextcloudTalk/NCDatabaseManager.m index 06b4aea21..c83f60dbd 100644 --- a/NextcloudTalk/NCDatabaseManager.m +++ b/NextcloudTalk/NCDatabaseManager.m @@ -33,7 +33,7 @@ NSString *const kTalkDatabaseFolder = @"Library/Application Support/Talk"; NSString *const kTalkDatabaseFileName = @"talk.realm"; -uint64_t const kTalkDatabaseSchemaVersion = 47; +uint64_t const kTalkDatabaseSchemaVersion = 48; NSString * const kCapabilitySystemMessages = @"system-messages"; NSString * const kCapabilityNotificationLevels = @"notification-levels"; @@ -374,6 +374,8 @@ - (void)setServerCapabilities:(NSDictionary *)serverCapabilities forAccountId:(N capabilities.readStatusPrivacy = [[[[talkCaps objectForKey:@"config"] objectForKey:@"chat"] objectForKey:@"read-privacy"] boolValue]; capabilities.accountPropertyScopesVersion2 = [[provisioningAPICaps objectForKey:@"AccountPropertyScopesVersion"] integerValue] == 2; capabilities.accountPropertyScopesFederationEnabled = [[provisioningAPICaps objectForKey:@"AccountPropertyScopesFederationEnabled"] boolValue]; + capabilities.accountPropertyScopesFederatedEnabled = [[provisioningAPICaps objectForKey:@"AccountPropertyScopesFederatedEnabled"] boolValue]; + capabilities.accountPropertyScopesPublishedEnabled = [[provisioningAPICaps objectForKey:@"AccountPropertyScopesPublishedEnabled"] boolValue]; capabilities.talkVersion = [talkCaps objectForKey:@"version"]; capabilities.guestsAppEnabled = [[guestsCaps objectForKey:@"enabled"] boolValue]; capabilities.referenceApiSupported = [[coreCaps objectForKey:@"reference-api"] boolValue]; diff --git a/NextcloudTalk/ServerCapabilities.h b/NextcloudTalk/ServerCapabilities.h index caa06f0e8..fc0ccdb4f 100644 --- a/NextcloudTalk/ServerCapabilities.h +++ b/NextcloudTalk/ServerCapabilities.h @@ -55,6 +55,8 @@ NS_ASSUME_NONNULL_BEGIN @property BOOL readStatusPrivacy; @property BOOL accountPropertyScopesVersion2; @property BOOL accountPropertyScopesFederationEnabled; +@property BOOL accountPropertyScopesFederatedEnabled; +@property BOOL accountPropertyScopesPublishedEnabled; @property BOOL callEnabled; @property NSString *talkVersion; @property NSString *externalSignalingServerVersion; diff --git a/NextcloudTalk/UserProfileTableViewController+Utils.swift b/NextcloudTalk/UserProfileTableViewController+Utils.swift index 67a86ee66..90e1c5b97 100644 --- a/NextcloudTalk/UserProfileTableViewController+Utils.swift +++ b/NextcloudTalk/UserProfileTableViewController+Utils.swift @@ -247,10 +247,17 @@ extension UserProfileTableViewController { options.append(localOption) let serverCapabilities = NCDatabaseManager.sharedInstance().serverCapabilities(forAccountId: account.accountId) + // Legacy capability if serverCapabilities.accountPropertyScopesFederationEnabled { options.append(federatedOption) options.append(publishedOption) } + if serverCapabilities.accountPropertyScopesFederatedEnabled { + options.append(federatedOption) + } + if serverCapabilities.accountPropertyScopesPublishedEnabled { + options.append(publishedOption) + } let optionSelectorVC = DetailedOptionsSelectorTableViewController(options: options, forSenderIdentifier: field, andStyle: .insetGrouped) if let optionSelectorVC = optionSelectorVC { diff --git a/NextcloudTalk/UserProfileTableViewController.swift b/NextcloudTalk/UserProfileTableViewController.swift index 1e460d9fc..aaf88d5e5 100644 --- a/NextcloudTalk/UserProfileTableViewController.swift +++ b/NextcloudTalk/UserProfileTableViewController.swift @@ -238,7 +238,8 @@ extension UserProfileTableViewController { var headerView = HeaderWithButton() headerView.button.addTarget(self, action: #selector(showScopeSelectionDialog(_:)), for: .touchUpInside) let serverCapabilities = NCDatabaseManager.sharedInstance().serverCapabilities(forAccountId: account.accountId) - let shouldEnableNameAndEmailScopeButton = serverCapabilities.accountPropertyScopesFederationEnabled + let shouldEnableNameAndEmailScopeButton = serverCapabilities.accountPropertyScopesFederationEnabled || + serverCapabilities.accountPropertyScopesFederatedEnabled || serverCapabilities.accountPropertyScopesPublishedEnabled switch profileSection { case ProfileSection.kProfileSectionName.rawValue: