Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions WordPress/Classes/Models/Blog/Blog+Capabilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions WordPress/Classes/Models/Blog/Blog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Role *> *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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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) {
Expand Down