Skip to content

Commit

Permalink
Merge pull request #13831 from wordpress-mobile/try/integrate-D41085
Browse files Browse the repository at this point in the history
Wires site_is_atomic from the reader endpoint.
  • Loading branch information
diegoreymendez authored Apr 9, 2020
2 parents f4f665d + bb7d122 commit 92c3916
Show file tree
Hide file tree
Showing 9 changed files with 876 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def wordpress_ui
end

def wordpress_kit
pod 'WordPressKit', '~> 4.7.0'
pod 'WordPressKit', '~> 4.7.1-beta.1'

#pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :tag => '4.6.0-beta.3'
#pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => ''
Expand Down
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ PODS:
- WordPressKit (~> 4.7.0)
- WordPressShared (~> 1.8.16)
- WordPressUI (~> 1.5.2)
- WordPressKit (4.7.0):
- WordPressKit (4.7.1-beta.1):
- Alamofire (~> 4.8.0)
- CocoaLumberjack (~> 3.4)
- NSObject-SafeExpectations (= 0.0.4)
Expand Down Expand Up @@ -480,7 +480,7 @@ DEPENDENCIES:
- SVProgressHUD (= 2.2.5)
- WordPress-Editor-iOS (~> 1.17.1)
- WordPressAuthenticator (~> 1.12.1)
- WordPressKit (~> 4.7.0)
- WordPressKit (~> 4.7.1-beta.1)
- WordPressMocks (~> 0.0.8)
- WordPressShared (~> 1.8.16)
- WordPressUI (~> 1.5.3-beta.1)
Expand Down Expand Up @@ -698,7 +698,7 @@ SPEC CHECKSUMS:
WordPress-Aztec-iOS: 319620514af963ca519bd83b96a2c0ebdf3a0f03
WordPress-Editor-iOS: 497b55838ef0030cc6ca82eb92da84e661423521
WordPressAuthenticator: d69a1516525a078abc0e6ed9692d4c1c3c866317
WordPressKit: 0602e8188245b3267269570d3d78c138e64a4eba
WordPressKit: dde0a214279fb70d7150b69ae90c7224c18fe2d0
WordPressMocks: b4064b99a073117bbc304abe82df78f2fbe60992
WordPressShared: 1bc316ed162f42af4e0fa2869437e9e28b532b01
WordPressUI: 91b91e51b8cd7db83a2bd492c12998db711a6a57
Expand All @@ -714,6 +714,6 @@ SPEC CHECKSUMS:
ZendeskSupportSDK: a87ab1e4badace92c75eb11dc77ede1e995b2adc
ZIPFoundation: 249fa8890597086cd536bb2df5c9804d84e122b0

PODFILE CHECKSUM: 6a01cb2728f23526b2998f507ebb3d0afdabdaf9
PODFILE CHECKSUM: 8f757fa2c0ba428e705b7ef942992892ccf3ffdd

COCOAPODS: 1.8.4
1 change: 1 addition & 0 deletions WordPress/Classes/Models/ReaderPost.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern NSString * const ReaderPostStoredCommentTextKey;
@property (nonatomic, strong) NSNumber *feedID;
@property (nonatomic, strong) NSNumber *feedItemID;
@property (nonatomic, strong) NSString *globalID;
@property (nonatomic) BOOL isBlogAtomic;
@property (nonatomic) BOOL isBlogPrivate;
@property (nonatomic) BOOL isFollowing;
@property (nonatomic) BOOL isLiked;
Expand Down
7 changes: 2 additions & 5 deletions WordPress/Classes/Models/ReaderPost.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ @implementation ReaderPost
@dynamic featuredImage;
@dynamic feedID;
@dynamic feedItemID;
@dynamic isBlogAtomic;
@dynamic isBlogPrivate;
@dynamic isFollowing;
@dynamic isLiked;
Expand Down Expand Up @@ -67,11 +68,7 @@ - (BOOL)isCrossPost

- (BOOL)isAtomic
{
// TODO: This is temporary until we start parsing a new value from the reader endpoint.
//
// Issue: https://git.io/JvNAN
//
return false;
return self.isBlogAtomic;
}

- (BOOL)isPrivate
Expand Down
1 change: 1 addition & 0 deletions WordPress/Classes/Services/ReaderPostService.m
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,7 @@ - (ReaderPost *)createOrReplaceFromRemotePost:(RemoteReaderPost *)remotePost for
post.feedID = remotePost.feedID;
post.feedItemID = remotePost.feedItemID;
post.globalID = remotePost.globalID;
post.isBlogAtomic = remotePost.isBlogAtomic;
post.isBlogPrivate = remotePost.isBlogPrivate;
post.isFollowing = remotePost.isFollowing;
post.isLiked = remotePost.isLiked;
Expand Down
24 changes: 19 additions & 5 deletions WordPress/Classes/ViewRelated/Reader/ReaderCrossPostCell.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import AlamofireImage
import Foundation
import AutomatticTracks
import WordPressShared.WPStyleGuide

open class ReaderCrossPostCell: UITableViewCell {
Expand Down Expand Up @@ -90,11 +92,23 @@ open class ReaderCrossPostCell: UITableViewCell {
let placeholder = UIImage(named: blavatarPlaceholder)

let size = blavatarImageView.frame.size.width * UIScreen.main.scale
let url = contentProvider?.siteIconForDisplay(ofSize: Int(size))
if url != nil {
blavatarImageView.downloadImage(from: url, placeholderImage: placeholder)
} else {
blavatarImageView.image = placeholder

guard let contentProvider = contentProvider,
let url = contentProvider.siteIconForDisplay(ofSize: Int(size)) else {
blavatarImageView.image = placeholder
return
}

let host = MediaHost(with: contentProvider) { error in
CrashLogging.logError(error)
}

let mediaAuthenticator = MediaRequestAuthenticator()
mediaAuthenticator.authenticatedRequest(for: url, from: host, onComplete: { [weak self] request in
self?.blavatarImageView.af_setImage(withURLRequest: request, placeholderImage: placeholder)
}) { [weak self] error in
CrashLogging.logError(error)
self?.blavatarImageView.image = placeholder
}
}

Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>WordPress 94.xcdatamodel</string>
<string>WordPress 95.xcdatamodel</string>
</dict>
</plist>
Loading

0 comments on commit 92c3916

Please sign in to comment.