This repository was archived by the owner on Sep 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ import Foundation
5858 /// Blog's total disk quota space used.
5959 public var quotaSpaceUsed : NSNumber ?
6060
61+ public var isDeleted : Bool
62+
6163 /// Parses details from a JSON dictionary, as returned by the WordPress.com REST API.
6264 @objc ( initWithJSONDictionary: )
6365 public init ( jsonDictionary json: NSDictionary ) {
@@ -79,6 +81,7 @@ import Foundation
7981 self . planActiveFeatures = ( json. array ( forKeyPath: " plan.features.active " ) as? [ String ] ) ?? [ ]
8082 self . quotaSpaceAllowed = json. number ( forKeyPath: " quota.space_allowed " )
8183 self . quotaSpaceUsed = json. number ( forKeyPath: " quota.space_used " )
84+ self . isDeleted = json. number ( forKey: " is_deleted " ) ? . boolValue == true
8285 }
8386
8487}
Original file line number Diff line number Diff line change @@ -385,10 +385,14 @@ - (RemoteUser *)remoteUserFromDictionary:(NSDictionary *)dictionary
385385- (NSArray *)remoteBlogsFromJSONArray : (NSArray *)jsonBlogs
386386{
387387 NSArray *blogs = jsonBlogs;
388- return [blogs wpkit_map: ^id (NSDictionary *jsonBlog) {
388+ return [[ blogs wpkit_map: ^id (NSDictionary *jsonBlog) {
389389 return [[RemoteBlog alloc ] initWithJSONDictionary: jsonBlog];
390+ }] wpkit_filter: ^BOOL (RemoteBlog *blog) {
391+ // Exclude deleted sites from query result, since the app does not handle deleted sites properly.
392+ // I tried to use query arguments `site_visibility=visible` and `site_activity=active`, but neither excludes
393+ // deleted sites.
394+ return !blog.isDeleted ;
390395 }];
391- return blogs;
392396}
393397
394398@end
You can’t perform that action at this time.
0 commit comments