Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions WordPress/Classes/Models/Blog.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@class UserSuggestion;
@class SiteSuggestion;
@class PageTemplateCategory;
@class JetpackFeaturesRemovalCoordinator;

extern NSString * const BlogEntityName;
extern NSString * const PostFormatStandard;
Expand Down Expand Up @@ -76,6 +77,8 @@ typedef NS_ENUM(NSUInteger, BlogFeature) {
BlogFeatureMediaDeletion,
/// Does the blog support Stock Photos feature (free photos library)
BlogFeatureStockPhotos,
/// Does the blog support Tenor feature (free GIF library)
BlogFeatureTenor,
/// Does the blog support setting the homepage type and pages?
BlogFeatureHomepageSettings,
/// Does the blog support stories?
Expand Down
5 changes: 4 additions & 1 deletion WordPress/Classes/Models/Blog.m
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,11 @@ - (BOOL)supports:(BlogFeature)feature
case BlogFeatureWPComRESTAPI:
case BlogFeatureCommentLikes:
case BlogFeatureStats:
case BlogFeatureStockPhotos:
return [self supportsRestApi];
case BlogFeatureStockPhotos:
return [self supportsRestApi] && ![JetpackFeaturesRemovalCoordinator shouldRemoveJetpackFeatures];
case BlogFeatureTenor:
return ![JetpackFeaturesRemovalCoordinator shouldRemoveJetpackFeatures];
case BlogFeatureSharing:
return [self supportsSharing];
case BlogFeatureOAuth2Login:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ extension GutenbergViewController: GutenbergBridgeDataSource {
func gutenbergMediaSources() -> [Gutenberg.MediaSource] {
return [
post.blog.supports(.stockPhotos) ? .stockPhotos : nil,
.tenor,
post.blog.supports(.tenor) ? .tenor : nil,
.otherApps,
.allFiles,
].compactMap { $0 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ final class MediaLibraryMediaPickingCoordinator {
if blog.supports(.stockPhotos) {
menuAlert.addAction(freePhotoAction(origin: origin, blog: blog))
}
if blog.supports(.tenor) {
menuAlert.addAction(tenorAction(origin: origin, blog: blog))
}

menuAlert.addAction(tenorAction(origin: origin, blog: blog))
menuAlert.addAction(otherAppsAction(origin: origin, blog: blog))
menuAlert.addAction(cancelAction())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ final class AztecMediaPickingCoordinator {
if blog.supports(.stockPhotos) {
alertController.addAction(freePhotoAction(origin: origin, blog: blog))
}
if blog.supports(.tenor) {
alertController.addAction(tenorAction(origin: origin, blog: blog))
}

alertController.addAction(tenorAction(origin: origin, blog: blog))
alertController.addAction(otherAppsAction(origin: origin, blog: blog))
alertController.addAction(cancelAction())

Expand Down