Skip to content

Commit aebe3f9

Browse files
committed
Rename Blog.wordPressOrgRestApi to selfHostedSiteRestApi
1 parent 7d4a72e commit aebe3f9

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

WordPress/Classes/Models/Blog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ typedef NS_ENUM(NSInteger, SiteVisibility) {
208208
@property (nonatomic, weak, readonly, nullable) NSArray *sortedConnections;
209209
@property (nonatomic, readonly, nullable) NSArray<Role *> *sortedRoles;
210210
@property (nonatomic, strong, readonly, nullable) WordPressOrgXMLRPCApi *xmlrpcApi;
211-
@property (nonatomic, strong, readonly, nullable) WordPressOrgRestApi *wordPressOrgRestApi;
211+
@property (nonatomic, strong, readonly, nullable) WordPressOrgRestApi *selfHostedSiteRestApi;
212212
@property (nonatomic, weak, readonly, nullable) NSString *version;
213213
@property (nonatomic, strong, readonly, nullable) NSString *authToken;
214214
@property (nonatomic, strong, readonly, nullable) NSSet *allowedFileTypes;

WordPress/Classes/Models/Blog.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
@interface Blog ()
3535

3636
@property (nonatomic, strong, readwrite) WordPressOrgXMLRPCApi *xmlrpcApi;
37-
@property (nonatomic, strong, readwrite) WordPressOrgRestApi *wordPressOrgRestApi;
37+
@property (nonatomic, strong, readwrite) WordPressOrgRestApi *selfHostedSiteRestApi;
3838

3939
@end
4040

@@ -99,7 +99,7 @@ @implementation Blog
9999
@synthesize videoPressEnabled;
100100
@synthesize isSyncingMedia;
101101
@synthesize xmlrpcApi = _xmlrpcApi;
102-
@synthesize wordPressOrgRestApi = _wordPressOrgRestApi;
102+
@synthesize selfHostedSiteRestApi = _selfHostedSiteRestApi;
103103

104104
#pragma mark - NSManagedObject subclass methods
105105

@@ -113,7 +113,7 @@ - (void)prepareForDeletion
113113
}
114114

115115
[_xmlrpcApi invalidateAndCancelTasks];
116-
[_wordPressOrgRestApi invalidateAndCancelTasks];
116+
[_selfHostedSiteRestApi invalidateAndCancelTasks];
117117
}
118118

119119
- (void)didTurnIntoFault
@@ -122,7 +122,7 @@ - (void)didTurnIntoFault
122122

123123
// Clean up instance variables
124124
self.xmlrpcApi = nil;
125-
self.wordPressOrgRestApi = nil;
125+
self.selfHostedSiteRestApi = nil;
126126
[[NSNotificationCenter defaultCenter] removeObserver:self];
127127
}
128128

@@ -701,7 +701,7 @@ - (BOOL)supportsPluginManagement
701701
// Reference: https://make.wordpress.org/core/2020/07/16/new-and-modified-rest-api-endpoints-in-wordpress-5-5/
702702
if(!supports && !self.account){
703703
supports = !self.isHostedAtWPcom
704-
&& self.wordPressOrgRestApi
704+
&& self.selfHostedSiteRestApi
705705
&& [self hasRequiredWordPressVersion:@"5.5"];
706706
}
707707

@@ -886,12 +886,12 @@ - (WordPressOrgXMLRPCApi *)xmlrpcApi
886886
return _xmlrpcApi;
887887
}
888888

889-
- (WordPressOrgRestApi *)wordPressOrgRestApi
889+
- (WordPressOrgRestApi *)selfHostedSiteRestApi
890890
{
891-
if (_wordPressOrgRestApi == nil) {
892-
_wordPressOrgRestApi = self.account == nil ? [[WordPressOrgRestApi alloc] initWithBlog:self] : nil;
891+
if (_selfHostedSiteRestApi == nil) {
892+
_selfHostedSiteRestApi = self.account == nil ? [[WordPressOrgRestApi alloc] initWithBlog:self] : nil;
893893
}
894-
return _wordPressOrgRestApi;
894+
return _selfHostedSiteRestApi;
895895
}
896896

897897
- (WordPressComRestApi *)wordPressComRestApi

WordPress/Classes/Stores/PluginStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ private extension PluginStore {
803803
}
804804

805805
private func selfHostedRemoteClient(site: JetpackSiteRef) -> PluginManagementClient? {
806-
guard let remote = BlogService.blog(with: site)?.wordPressOrgRestApi else {
806+
guard let remote = BlogService.blog(with: site)?.selfHostedSiteRestApi else {
807807
return nil
808808
}
809809

WordPress/Classes/ViewRelated/Gutenberg/GutenbergNetworking.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct GutenbergNetworkRequest {
6565
}
6666

6767
private func performSelfHostedRequest(completion: @escaping CompletionHandler) {
68-
guard let api = blog.wordPressOrgRestApi else {
68+
guard let api = blog.selfHostedSiteRestApi else {
6969
completion(.failure(NSError(domain: NSURLErrorDomain, code: NSURLErrorUnknown, userInfo: nil)))
7070
return
7171
}

WordPress/Classes/ViewRelated/Jetpack/Install/Webview/JetpackConnectionWebViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ private extension JetpackConnectionWebViewController {
361361
///
362362
private extension JetpackConnectionWebViewController {
363363
func startNativeConnectionFlow() {
364-
guard let api = blog.wordPressOrgRestApi else {
364+
guard let api = blog.selfHostedSiteRestApi else {
365365
DDLogInfo("WordPressOrgRestAPI not loaded to perform native Jetpack connection")
366366
startConnectionFlow()
367367
return

0 commit comments

Comments
 (0)