diff --git a/WordPress/Classes/Models/Blog/Blog+Capabilities.swift b/WordPress/Classes/Models/Blog/Blog+Capabilities.swift index ae00fa1621e7..7ff568add020 100644 --- a/WordPress/Classes/Models/Blog/Blog+Capabilities.swift +++ b/WordPress/Classes/Models/Blog/Blog+Capabilities.swift @@ -6,21 +6,21 @@ extension Blog { /// Enumeration that contains all of the Blog's available capabilities. /// public enum Capability: String { - case DeleteOthersPosts = "delete_others_posts" - case DeletePosts = "delete_posts" - case EditOthersPages = "edit_others_pages" - case EditOthersPosts = "edit_others_posts" - case EditPages = "edit_pages" - case EditPosts = "edit_posts" - case EditThemeOptions = "edit_theme_options" - case EditUsers = "edit_users" - case ListUsers = "list_users" - case ManageCategories = "manage_categories" - case ManageOptions = "manage_options" - case PromoteUsers = "promote_users" - case PublishPosts = "publish_posts" - case UploadFiles = "upload_files" - case ViewStats = "view_stats" + case DeleteOthersPosts = "delete_others_posts" + case DeletePosts = "delete_posts" + case EditOthersPages = "edit_others_pages" + case EditOthersPosts = "edit_others_posts" + case EditPages = "edit_pages" + case EditPosts = "edit_posts" + case EditThemeOptions = "edit_theme_options" + case EditUsers = "edit_users" + case ListUsers = "list_users" + case ManageCategories = "manage_categories" + case ManageOptions = "manage_options" + case PromoteUsers = "promote_users" + case PublishPosts = "publish_posts" + case UploadFiles = "upload_files" + case ViewStats = "view_stats" } /// Returns true if a given capability is enabled. False otherwise diff --git a/WordPress/Classes/Models/Blog/Blog.h b/WordPress/Classes/Models/Blog/Blog.h index 9cecad79e951..a82a4225b10c 100644 --- a/WordPress/Classes/Models/Blog/Blog.h +++ b/WordPress/Classes/Models/Blog/Blog.h @@ -194,20 +194,20 @@ typedef NS_ENUM(NSInteger, SiteVisibility) { * * @warn For WordPress.com or Jetpack Managed sites this will be nil. Use usernameForSite instead */ -@property (nonatomic, strong, readwrite, nullable) NSString *username; -@property (nonatomic, strong, readwrite, nullable) NSString *password; +@property (nonatomic, strong, readwrite, nullable) NSString *username; +@property (nonatomic, strong, readwrite, nullable) NSString *password; // Readonly Properties -@property (nonatomic, weak, readonly, nullable) NSArray *sortedPostFormatNames; -@property (nonatomic, weak, readonly, nullable) NSArray *sortedPostFormats; -@property (nonatomic, weak, readonly, nullable) NSArray *sortedConnections; +@property (nonatomic, weak, readonly, nullable) NSArray *sortedPostFormatNames; +@property (nonatomic, weak, readonly, nullable) NSArray *sortedPostFormats; +@property (nonatomic, weak, readonly, nullable) NSArray *sortedConnections; @property (nonatomic, readonly, nullable) NSArray *sortedRoles; -@property (nonatomic, strong, readonly, nullable) WordPressOrgXMLRPCApi *xmlrpcApi; -@property (nonatomic, strong, readonly, nullable) WordPressOrgRestApi *selfHostedSiteRestApi; -@property (nonatomic, weak, readonly, nullable) NSString *version; -@property (nonatomic, strong, readonly, nullable) NSString *authToken; -@property (nonatomic, strong, readonly, nullable) NSSet *allowedFileTypes; +@property (nonatomic, strong, readonly, nullable) WordPressOrgXMLRPCApi *xmlrpcApi; +@property (nonatomic, strong, readonly, nullable) WordPressOrgRestApi *selfHostedSiteRestApi; +@property (nonatomic, weak, readonly, nullable) NSString *version; +@property (nonatomic, strong, readonly, nullable) NSString *authToken; +@property (nonatomic, strong, readonly, nullable) NSSet *allowedFileTypes; @property (nonatomic, copy, readonly, nullable) NSString *usernameForSite; @property (nonatomic, assign, readonly) BOOL canBlaze; diff --git a/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+JetpackSocial.swift b/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+JetpackSocial.swift index 0dc845b52e85..f914613acda5 100644 --- a/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+JetpackSocial.swift +++ b/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController+JetpackSocial.swift @@ -8,7 +8,12 @@ extension PrepublishingViewController { /// Determines whether the account and the post's blog is eligible to see the Jetpack Social row. func canDisplaySocialRow(isJetpack: Bool = AppConfiguration.isJetpack, isFeatureEnabled: Bool = RemoteFeatureFlag.jetpackSocialImprovements.enabled()) -> Bool { - guard isJetpack && isFeatureEnabled && !isPostPrivate && hasPublicizeServices else { + guard isJetpack && + isFeatureEnabled && + !isPostPrivate && + hasPublicizeServices && + post.blog.supportsPublicize() + else { return false } @@ -17,12 +22,7 @@ extension PrepublishingViewController { return !isNoConnectionDismissed } - let blogSupportsPublicize = coreDataStack.performQuery { [postObjectID = post.objectID] context in - let post = (try? context.existingObject(with: postObjectID)) as? Post - return post?.blog.supportsPublicize() ?? false - } - - return blogSupportsPublicize + return true } func configureSocialCell(_ cell: UITableViewCell) {