Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 30b720c

Browse files
authored
Merge pull request #167 from wordpress-mobile/issues/check-attachments-for-displayable-image
Check attachments for displayable image.
2 parents d0c0d87 + e533573 commit 30b720c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

WordPressKit/PostServiceRemoteREST.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,9 @@ - (RemotePost *)remotePostFromJSONDictionary:(NSDictionary *)jsonPost {
438438
post.pathForDisplayImage = post.postThumbnailPath;
439439
} else {
440440
// parse contents for a suitable image
441-
if (!post.pathForDisplayImage) {
442-
post.pathForDisplayImage = [DisplayableImageHelper searchPostContentForImageToDisplay:post.content];
441+
post.pathForDisplayImage = [DisplayableImageHelper searchPostContentForImageToDisplay:post.content];
442+
if ([post.pathForDisplayImage length] == 0) {
443+
post.pathForDisplayImage = [DisplayableImageHelper searchPostAttachmentsForImageToDisplay:[jsonPost dictionaryForKey:@"attachments"] existingInContent:post.content];
443444
}
444445
}
445446

0 commit comments

Comments
 (0)