From bd440f087887be9d3c58a9c27d971e89bc0956af Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 15 Jun 2017 15:19:33 -0400 Subject: [PATCH 1/5] Respond to post-holiday code reviews. // FREEBIE --- Podfile | 4 +-- Podfile.lock | 9 ++---- .../Models/OWSMessagesBubblesSizeCalculator.m | 8 ++--- Signal/src/ProfileFetcherJob.swift | 29 +++++++++---------- .../ConversationView/MessagesViewController.m | 8 ++--- .../DebugUI/DebugUISessionState.m | 24 +++++++-------- .../DebugUI/DebugUIVerification.m | 2 +- .../FingerprintViewController.m | 8 ++--- .../FingerprintViewScanController.m | 2 +- .../SafetyNumberConfirmationAlert.swift | 2 +- Signal/src/call/CallService.swift | 6 ++-- Signal/src/views/OWSSystemMessageCell.m | 14 +-------- Signal/src/views/OWSUnreadIndicatorCell.m | 14 +-------- 13 files changed, 50 insertions(+), 80 deletions(-) diff --git a/Podfile b/Podfile index 64c1915dc1..a33208ad26 100644 --- a/Podfile +++ b/Podfile @@ -5,8 +5,8 @@ target 'Signal' do pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git' pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git' #pod 'AxolotlKit', path: '../SignalProtocolKit' - pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git' - #pod 'SignalServiceKit', path: '../SignalServiceKit' + #pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git' + pod 'SignalServiceKit', path: '../SignalServiceKit' pod 'JSQMessagesViewController', git: 'https://github.com/WhisperSystems/JSQMessagesViewController.git', branch: 'mkirk/position-edit-menu' #pod 'JSQMessagesViewController' path: '../JSQMessagesViewController' pod 'PureLayout' diff --git a/Podfile.lock b/Podfile.lock index 7b15cf5295..a26c971913 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -112,7 +112,7 @@ DEPENDENCIES: - JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController.git`, branch `mkirk/position-edit-menu`) - PureLayout - Reachability - - SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`) + - SignalServiceKit (from `../SignalServiceKit`) - SocketRocket (from `https://github.com/facebook/SocketRocket.git`) EXTERNAL SOURCES: @@ -122,7 +122,7 @@ EXTERNAL SOURCES: :branch: mkirk/position-edit-menu :git: https://github.com/WhisperSystems/JSQMessagesViewController.git SignalServiceKit: - :git: https://github.com/WhisperSystems/SignalServiceKit.git + :path: ../SignalServiceKit SocketRocket: :git: https://github.com/facebook/SocketRocket.git @@ -133,9 +133,6 @@ CHECKOUT OPTIONS: JSQMessagesViewController: :commit: 7054e4b13ee5bcd6d524adb6dc9a726e8c466308 :git: https://github.com/WhisperSystems/JSQMessagesViewController.git - SignalServiceKit: - :commit: a9bac8bce7ea3a0209024d0b0a937d45748aea97 - :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf :git: https://github.com/facebook/SocketRocket.git @@ -161,6 +158,6 @@ SPEC CHECKSUMS: UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d YapDatabase: cd911121580ff16675f65ad742a9eb0ab4d9e266 -PODFILE CHECKSUM: 89fd7aee1e2b0ca592ecc9dba0389e57b70f959b +PODFILE CHECKSUM: 6e5d90a9603eb043b395213fd8a29037d2276a8f COCOAPODS: 1.2.1 diff --git a/Signal/src/Models/OWSMessagesBubblesSizeCalculator.m b/Signal/src/Models/OWSMessagesBubblesSizeCalculator.m index 2be1073b77..b003c5c6c3 100644 --- a/Signal/src/Models/OWSMessagesBubblesSizeCalculator.m +++ b/Signal/src/Models/OWSMessagesBubblesSizeCalculator.m @@ -38,8 +38,8 @@ NS_ASSUME_NONNULL_BEGIN @interface OWSMessagesBubblesSizeCalculator () -@property (nonatomic) OWSSystemMessageCell *referenceSystemMessageCell; -@property (nonatomic) OWSUnreadIndicatorCell *referenceUnreadIndicatorCell; +@property (nonatomic, readonly) OWSSystemMessageCell *referenceSystemMessageCell; +@property (nonatomic, readonly) OWSUnreadIndicatorCell *referenceUnreadIndicatorCell; @end @@ -120,7 +120,7 @@ NS_ASSUME_NONNULL_BEGIN } if (!self.referenceSystemMessageCell) { - self.referenceSystemMessageCell = [OWSSystemMessageCell new]; + _referenceSystemMessageCell = [OWSSystemMessageCell new]; } CGSize result = [self.referenceSystemMessageCell cellSizeForInteraction:interaction @@ -144,7 +144,7 @@ NS_ASSUME_NONNULL_BEGIN } if (!self.referenceUnreadIndicatorCell) { - self.referenceUnreadIndicatorCell = [OWSUnreadIndicatorCell new]; + _referenceUnreadIndicatorCell = [OWSUnreadIndicatorCell new]; } CGSize result = [self.referenceUnreadIndicatorCell cellSizeForInteraction:interaction diff --git a/Signal/src/ProfileFetcherJob.swift b/Signal/src/ProfileFetcherJob.swift index dc8910c688..619df461f1 100644 --- a/Signal/src/ProfileFetcherJob.swift +++ b/Signal/src/ProfileFetcherJob.swift @@ -14,7 +14,7 @@ class ProfileFetcherJob: NSObject { let thread: TSThread - // This property is only accessed on the default global queue. + // This property is only accessed on the main queue. static var fetchDateMap = [String: Date]() public class func run(thread: TSThread, networkManager: TSNetworkManager) { @@ -31,7 +31,7 @@ class ProfileFetcherJob: NSObject { public func run() { AssertIsOnMainThread() - DispatchQueue.global().async { + DispatchQueue.main.async { for recipientId in self.thread.recipientIdentifiers { self.getProfile(recipientId: recipientId) } @@ -40,27 +40,24 @@ class ProfileFetcherJob: NSObject { public func getProfile(recipientId: String, remainingRetries: Int = 3) { - // Only throttle profile fetch in production builds in order to - // facilitate debugging. - if !_isDebugAssertConfiguration() { - if let lastDate = ProfileFetcherJob.fetchDateMap[recipientId] { - let lastTimeInterval = fabs(lastDate.timeIntervalSinceNow) - // Don't check a profile more often than every N minutes. - let kGetProfileMaxFrequencySeconds = 60.0 * 5.0 - if lastTimeInterval < kGetProfileMaxFrequencySeconds { - Logger.info("\(self.TAG) skipping getProfile: \(recipientId), lastTimeInterval: \(lastTimeInterval)") - return - } + if let lastDate = ProfileFetcherJob.fetchDateMap[recipientId] { + let lastTimeInterval = fabs(lastDate.timeIntervalSinceNow) + // Don't check a profile more often than every N minutes. + // + // Only throttle profile fetch in production builds in order to + // facilitate debugging. + let kGetProfileMaxFrequencySeconds = _isDebugAssertConfiguration() ? 0 : 60.0 * 5.0 + guard lastTimeInterval > kGetProfileMaxFrequencySeconds else { + Logger.info("\(self.TAG) skipping getProfile: \(recipientId), lastTimeInterval: \(lastTimeInterval)") + return } - ProfileFetcherJob.fetchDateMap[recipientId] = Date() } + ProfileFetcherJob.fetchDateMap[recipientId] = Date() Logger.error("\(self.TAG) getProfile: \(recipientId)") let request = OWSGetProfileRequest(recipientId: recipientId) - // We don't need to retainUntilComplete() since the success and failure - // handlers both close over a strong reference to self. self.networkManager.makeRequest( request, success: { (_: URLSessionDataTask?, responseObject: Any?) -> Void in diff --git a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m index c3c95660fb..a4e3b87cc1 100644 --- a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m +++ b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m @@ -685,7 +685,7 @@ typedef enum : NSUInteger { [result addObject:recipientId]; } } - return result; + return [result copy]; } - (void)ensureBannerState @@ -838,7 +838,7 @@ typedef enum : NSUInteger { preferredStyle:UIAlertControllerStyleActionSheet]; __weak MessagesViewController *weakSelf = self; - UIAlertAction *unblockAction = [UIAlertAction + UIAlertAction *verifyAction = [UIAlertAction actionWithTitle: NSLocalizedString(@"VERIFY_PRIVACY", @"Label for button or row which allows users to verify the safety number of another user.") @@ -846,7 +846,7 @@ typedef enum : NSUInteger { handler:^(UIAlertAction *_Nonnull action) { [weakSelf showConversationSettingsAndShowVerification:YES]; }]; - [actionSheetController addAction:unblockAction]; + [actionSheetController addAction:verifyAction]; UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"DISMISS_BUTTON_TEXT", @@ -882,7 +882,7 @@ typedef enum : NSUInteger { [OWSIdentityManager.sharedManager setVerificationState:OWSVerificationStateDefault identityKey:identityKey recipientId:recipientId - sendSyncMessage:YES]; + isUserInitiatedChange:YES]; } } diff --git a/Signal/src/ViewControllers/DebugUI/DebugUISessionState.m b/Signal/src/ViewControllers/DebugUI/DebugUISessionState.m index 6e19ae3ce8..2a5fb90016 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUISessionState.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUISessionState.m @@ -90,10 +90,10 @@ NS_ASSUME_NONNULL_BEGIN NSData *identityKey = [identityManger identityKeyForRecipientId:recipientId]; [[OWSIdentityManager sharedManager] - setVerificationState:OWSVerificationStateDefault - identityKey:identityKey - recipientId:recipientId - sendSyncMessage:NO]; + setVerificationState:OWSVerificationStateDefault + identityKey:identityKey + recipientId:recipientId + isUserInitiatedChange:NO]; }]]; [alertController addAction:[UIAlertAction actionWithTitle:@"Verified" style:UIAlertActionStyleDefault @@ -101,10 +101,10 @@ NS_ASSUME_NONNULL_BEGIN NSData *identityKey = [identityManger identityKeyForRecipientId:recipientId]; [[OWSIdentityManager sharedManager] - setVerificationState:OWSVerificationStateVerified - identityKey:identityKey - recipientId:recipientId - sendSyncMessage:NO]; + setVerificationState:OWSVerificationStateVerified + identityKey:identityKey + recipientId:recipientId + isUserInitiatedChange:NO]; }]]; [alertController addAction:[UIAlertAction actionWithTitle:@"No Longer Verified" style:UIAlertActionStyleDefault @@ -112,10 +112,10 @@ NS_ASSUME_NONNULL_BEGIN NSData *identityKey = [identityManger identityKeyForRecipientId:recipientId]; [[OWSIdentityManager sharedManager] - setVerificationState:OWSVerificationStateNoLongerVerified - identityKey:identityKey - recipientId:recipientId - sendSyncMessage:NO]; + setVerificationState:OWSVerificationStateNoLongerVerified + identityKey:identityKey + recipientId:recipientId + isUserInitiatedChange:NO]; }]]; [[UIApplication sharedApplication].frontmostViewController presentViewController:alertController diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIVerification.m b/Signal/src/ViewControllers/DebugUI/DebugUIVerification.m index 9f6890c950..1529a55120 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIVerification.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIVerification.m @@ -69,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN [OWSIdentityManager.sharedManager setVerificationState:verificationState identityKey:identityKey recipientId:recipientId - sendSyncMessage:verificationState != OWSVerificationStateNoLongerVerified]; + isUserInitiatedChange:verificationState != OWSVerificationStateNoLongerVerified]; } @end diff --git a/Signal/src/ViewControllers/FingerprintViewController.m b/Signal/src/ViewControllers/FingerprintViewController.m index e7a193d901..2286dd8f0d 100644 --- a/Signal/src/ViewControllers/FingerprintViewController.m +++ b/Signal/src/ViewControllers/FingerprintViewController.m @@ -510,10 +510,10 @@ typedef void (^CustomLayoutBlock)(); BOOL isVerified = [[OWSIdentityManager sharedManager] verificationStateForRecipientId:self.recipientId] == OWSVerificationStateVerified; [[OWSIdentityManager sharedManager] - setVerificationState:(isVerified ? OWSVerificationStateDefault : OWSVerificationStateVerified)identityKey - :self.identityKey - recipientId:self.recipientId - sendSyncMessage:YES]; + setVerificationState:(isVerified ? OWSVerificationStateDefault : OWSVerificationStateVerified)identityKey + :self.identityKey + recipientId:self.recipientId + isUserInitiatedChange:YES]; [self dismissViewControllerAnimated:YES completion:nil]; } diff --git a/Signal/src/ViewControllers/FingerprintViewScanController.m b/Signal/src/ViewControllers/FingerprintViewScanController.m index 30beaa3321..c49b42c2c0 100644 --- a/Signal/src/ViewControllers/FingerprintViewScanController.m +++ b/Signal/src/ViewControllers/FingerprintViewScanController.m @@ -205,7 +205,7 @@ NS_ASSUME_NONNULL_BEGIN [OWSIdentityManager.sharedManager setVerificationState:OWSVerificationStateVerified identityKey:identityKey recipientId:recipientId - sendSyncMessage:YES]; + isUserInitiatedChange:YES]; [viewController dismissViewControllerAnimated:true completion:nil]; }]]; UIAlertAction *dismissAction = diff --git a/Signal/src/ViewControllers/SafetyNumberConfirmationAlert.swift b/Signal/src/ViewControllers/SafetyNumberConfirmationAlert.swift index 8e47fc2c9c..44f2ac1aab 100644 --- a/Signal/src/ViewControllers/SafetyNumberConfirmationAlert.swift +++ b/Signal/src/ViewControllers/SafetyNumberConfirmationAlert.swift @@ -55,7 +55,7 @@ class SafetyNumberConfirmationAlert: NSObject { Logger.info("\(self.TAG) Confirmed identity: \(untrustedIdentity)") OWSDispatch.sessionStoreQueue().async { - OWSIdentityManager.shared().setVerificationState(.default, identityKey: untrustedIdentity.identityKey, recipientId: untrustedIdentity.recipientId, sendSyncMessage: true) + OWSIdentityManager.shared().setVerificationState(.default, identityKey: untrustedIdentity.identityKey, recipientId: untrustedIdentity.recipientId, isUserInitiatedChange: true) DispatchQueue.main.async { completion(true) } diff --git a/Signal/src/call/CallService.swift b/Signal/src/call/CallService.swift index be252faed1..e9a61740c5 100644 --- a/Signal/src/call/CallService.swift +++ b/Signal/src/call/CallService.swift @@ -500,13 +500,13 @@ protocol CallServiceObserver: class { return } - + guard self.call == nil else { // TODO on iOS10+ we can use CallKit to swap calls rather than just returning busy immediately. Logger.info("\(TAG) receivedCallOffer for thread: \(thread) but we're already in call: \(call!)") - + handleLocalBusyCall(newCall, thread: thread) - + return } diff --git a/Signal/src/views/OWSSystemMessageCell.m b/Signal/src/views/OWSSystemMessageCell.m index 37c1eec5d8..2ade8c5eb5 100644 --- a/Signal/src/views/OWSSystemMessageCell.m +++ b/Signal/src/views/OWSSystemMessageCell.m @@ -40,21 +40,9 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)init -{ - if (self = [super init]) { - [self commontInit]; - } - - return self; -} - - (void)commontInit { - if (self.imageView) { - // Don't init twice. - return; - } + OWSAssert(!self.imageView); [self setTranslatesAutoresizingMaskIntoConstraints:NO]; diff --git a/Signal/src/views/OWSUnreadIndicatorCell.m b/Signal/src/views/OWSUnreadIndicatorCell.m index c3599152ed..2af3c76106 100644 --- a/Signal/src/views/OWSUnreadIndicatorCell.m +++ b/Signal/src/views/OWSUnreadIndicatorCell.m @@ -38,21 +38,9 @@ NS_ASSUME_NONNULL_BEGIN return self; } -- (instancetype)init -{ - if (self = [super init]) { - [self commontInit]; - } - - return self; -} - - (void)commontInit { - if (self.bannerView) { - // Don't init twice. - return; - } + OWSAssert(!self.bannerView); [self setTranslatesAutoresizingMaskIntoConstraints:NO]; From 90c4ba27bf0ccb5573f2c2392e3628008f338eaf Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 15 Jun 2017 16:20:33 -0400 Subject: [PATCH 2/5] Respond to post-holiday code reviews. // FREEBIE --- .../ViewControllers/ConversationView/MessagesViewController.m | 2 +- Signal/src/ViewControllers/FingerprintViewController.h | 2 +- Signal/src/ViewControllers/FingerprintViewController.m | 2 +- .../OWSConversationSettingsTableViewController.m | 2 +- Signal/src/ViewControllers/SafetyNumberConfirmationAlert.swift | 2 +- Signal/src/ViewControllers/ShowGroupMembersViewController.m | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m index a4e3b87cc1..0b3af7343a 100644 --- a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m +++ b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m @@ -1341,7 +1341,7 @@ typedef enum : NSUInteger { // return from FingerprintViewController. [self dismissKeyBoard]; - [FingerprintViewController showVerificationViewFromViewController:self recipientId:recipientId]; + [FingerprintViewController presentFromViewController:self recipientId:recipientId]; } #pragma mark - Calls diff --git a/Signal/src/ViewControllers/FingerprintViewController.h b/Signal/src/ViewControllers/FingerprintViewController.h index e612cd3ae6..43642b75e9 100644 --- a/Signal/src/ViewControllers/FingerprintViewController.h +++ b/Signal/src/ViewControllers/FingerprintViewController.h @@ -6,7 +6,7 @@ NS_ASSUME_NONNULL_BEGIN @interface FingerprintViewController : UIViewController -+ (void)showVerificationViewFromViewController:(UIViewController *)viewController recipientId:(NSString *)recipientId; ++ (void)presentFromViewController:(UIViewController *)viewController recipientId:(NSString *)recipientId; @end diff --git a/Signal/src/ViewControllers/FingerprintViewController.m b/Signal/src/ViewControllers/FingerprintViewController.m index 2286dd8f0d..747b2fe8b4 100644 --- a/Signal/src/ViewControllers/FingerprintViewController.m +++ b/Signal/src/ViewControllers/FingerprintViewController.m @@ -89,7 +89,7 @@ typedef void (^CustomLayoutBlock)(); @implementation FingerprintViewController -+ (void)showVerificationViewFromViewController:(UIViewController *)viewController recipientId:(NSString *)recipientId ++ (void)presentFromViewController:(UIViewController *)viewController recipientId:(NSString *)recipientId { OWSAssert(recipientId.length > 0); diff --git a/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m b/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m index 24fac89c0d..dcca829673 100644 --- a/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m +++ b/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m @@ -679,7 +679,7 @@ NS_ASSUME_NONNULL_BEGIN NSString *recipientId = self.thread.contactIdentifier; OWSAssert(recipientId.length > 0); - [FingerprintViewController showVerificationViewFromViewController:self recipientId:recipientId]; + [FingerprintViewController presentFromViewController:self recipientId:recipientId]; } - (void)showGroupMembersView diff --git a/Signal/src/ViewControllers/SafetyNumberConfirmationAlert.swift b/Signal/src/ViewControllers/SafetyNumberConfirmationAlert.swift index 44f2ac1aab..311f1b9fc3 100644 --- a/Signal/src/ViewControllers/SafetyNumberConfirmationAlert.swift +++ b/Signal/src/ViewControllers/SafetyNumberConfirmationAlert.swift @@ -86,7 +86,7 @@ class SafetyNumberConfirmationAlert: NSObject { Logger.info("\(self.TAG) Missing frontmostViewController") return } - FingerprintViewController.showVerificationView(from:fromViewController, recipientId:theirRecipientId) + FingerprintViewController.present(from:fromViewController, recipientId:theirRecipientId) } private func untrustedIdentityForSending(recipientIds: [String]) -> OWSRecipientIdentity? { diff --git a/Signal/src/ViewControllers/ShowGroupMembersViewController.m b/Signal/src/ViewControllers/ShowGroupMembersViewController.m index 54751c95c8..76a0bf93fc 100644 --- a/Signal/src/ViewControllers/ShowGroupMembersViewController.m +++ b/Signal/src/ViewControllers/ShowGroupMembersViewController.m @@ -317,7 +317,7 @@ NS_ASSUME_NONNULL_BEGIN { OWSAssert(recipientId.length > 0); - [FingerprintViewController showVerificationViewFromViewController:self recipientId:recipientId]; + [FingerprintViewController presentFromViewController:self recipientId:recipientId]; } #pragma mark - ContactsViewHelperDelegate From 3c59678b7db6a4cf3c48544fb1c380a6f70e7d30 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 16 Jun 2017 13:51:21 -0400 Subject: [PATCH 3/5] Respond to CR. // FREEBIE --- Signal/translations/en.lproj/Localizable.strings | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index d263bb96c1..e8bf82738d 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -728,13 +728,13 @@ "MESSAGE_STATUS_UPLOADING" = "Uploading…"; /* Indicates that one member of this group conversation is no longer verified. Embeds {{user's name or phone number}}. */ -"MESSAGES_VIEW_1_MEMBER_NO_LONGER_VERIFIED_FORMAT" = "%@ is no longer verified. Tap for options."; +"MESSAGES_VIEW_1_MEMBER_NO_LONGER_VERIFIED_FORMAT" = "%@ is no longer marked as verified. Tap for options."; /* Indicates that this 1:1 conversation has been blocked. */ "MESSAGES_VIEW_CONTACT_BLOCKED" = "You Blocked this User"; /* Indicates that this 1:1 conversation is no longer verified. Embeds {{user's name or phone number}}. */ -"MESSAGES_VIEW_CONTACT_NO_LONGER_VERIFIED_FORMAT" = "%@ is no longer verified. Tap for options."; +"MESSAGES_VIEW_CONTACT_NO_LONGER_VERIFIED_FORMAT" = "%@ is no longer marked as verified. Tap for options."; /* Action sheet title after tapping on failed download. */ "MESSAGES_VIEW_FAILED_DOWNLOAD_ACTIONSHEET_TITLE" = "Download Failed."; @@ -749,7 +749,7 @@ "MESSAGES_VIEW_GROUP_N_MEMBERS_BLOCKED_FORMAT" = "You Blocked %d Members of this Group"; /* Indicates that more than one member of this group conversation is no longer verified. */ -"MESSAGES_VIEW_N_MEMBERS_NO_LONGER_VERIFIED" = "More than one member of this group is no longer verified. Tap for options."; +"MESSAGES_VIEW_N_MEMBERS_NO_LONGER_VERIFIED" = "More than one member of this group is no longer marked as verified. Tap for options."; /* The subtitle for the messages view title indicates that the title can be tapped to access settings for this conversation. */ "MESSAGES_VIEW_TITLE_SUBTITLE" = "Tap here for settings"; @@ -962,7 +962,7 @@ "PHONE_NUMBER_TYPE_WORK_FAX" = "Work Fax"; /* Label indicating that the user is not verified. Embeds {{the user's name or phone number}}. */ -"PRIVACY_IDENTITY_IS_NOT_VERIFIED_FORMAT" = "%@ is not verified."; +"PRIVACY_IDENTITY_IS_NOT_VERIFIED_FORMAT" = "You have not marked %@ as verified."; /* Badge indicating that the user is verified. */ "PRIVACY_IDENTITY_IS_VERIFIED_BADGE" = "Verified"; From ab95b04e564cc2f8fd4d7471139b99d004e16a9c Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Sat, 17 Jun 2017 13:47:10 -0400 Subject: [PATCH 4/5] Respond to CR. // FREEBIE --- .../Models/OWSMessagesBubblesSizeCalculator.m | 17 +++++++++-------- .../ConversationView/MessagesViewController.m | 2 +- Signal/src/views/OWSSystemMessageCell.m | 1 + Signal/src/views/OWSUnreadIndicatorCell.m | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Signal/src/Models/OWSMessagesBubblesSizeCalculator.m b/Signal/src/Models/OWSMessagesBubblesSizeCalculator.m index b003c5c6c3..3e48bb8225 100644 --- a/Signal/src/Models/OWSMessagesBubblesSizeCalculator.m +++ b/Signal/src/Models/OWSMessagesBubblesSizeCalculator.m @@ -47,6 +47,15 @@ NS_ASSUME_NONNULL_BEGIN @implementation OWSMessagesBubblesSizeCalculator +- (instancetype)init +{ + if (self = [super init]) { + _referenceSystemMessageCell = [OWSSystemMessageCell new]; + _referenceUnreadIndicatorCell = [OWSUnreadIndicatorCell new]; + } + return self; +} + /** * Computes and returns the size of the `messageBubbleImageView` property * of a `JSQMessagesCollectionViewCell` for the specified messageData at indexPath. @@ -119,10 +128,6 @@ NS_ASSUME_NONNULL_BEGIN return [cachedSize CGSizeValue]; } - if (!self.referenceSystemMessageCell) { - _referenceSystemMessageCell = [OWSSystemMessageCell new]; - } - CGSize result = [self.referenceSystemMessageCell cellSizeForInteraction:interaction collectionViewWidth:layout.collectionView.width]; @@ -143,10 +148,6 @@ NS_ASSUME_NONNULL_BEGIN return [cachedSize CGSizeValue]; } - if (!self.referenceUnreadIndicatorCell) { - _referenceUnreadIndicatorCell = [OWSUnreadIndicatorCell new]; - } - CGSize result = [self.referenceUnreadIndicatorCell cellSizeForInteraction:interaction collectionViewWidth:layout.collectionView.width]; diff --git a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m index 0b3af7343a..ea8e7fe3e1 100644 --- a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m +++ b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m @@ -1308,7 +1308,7 @@ typedef enum : NSUInteger { } // Bubbles - self.collectionView.collectionViewLayout.bubbleSizeCalculator = [[OWSMessagesBubblesSizeCalculator alloc] init]; + self.collectionView.collectionViewLayout.bubbleSizeCalculator = [OWSMessagesBubblesSizeCalculator new]; JSQMessagesBubbleImageFactory *bubbleFactory = [[JSQMessagesBubbleImageFactory alloc] init]; self.incomingBubbleImageData = [bubbleFactory incomingMessagesBubbleImageWithColor:[UIColor jsq_messageBubbleLightGrayColor]]; diff --git a/Signal/src/views/OWSSystemMessageCell.m b/Signal/src/views/OWSSystemMessageCell.m index 2ade8c5eb5..0e72a5a884 100644 --- a/Signal/src/views/OWSSystemMessageCell.m +++ b/Signal/src/views/OWSSystemMessageCell.m @@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN @implementation OWSSystemMessageCell +// `[UIView init]` invokes `[self initWithFrame:...]`. - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { diff --git a/Signal/src/views/OWSUnreadIndicatorCell.m b/Signal/src/views/OWSUnreadIndicatorCell.m index 2af3c76106..3abaa0e8c3 100644 --- a/Signal/src/views/OWSUnreadIndicatorCell.m +++ b/Signal/src/views/OWSUnreadIndicatorCell.m @@ -29,6 +29,7 @@ NS_ASSUME_NONNULL_BEGIN @implementation OWSUnreadIndicatorCell +// `[UIView init]` invokes `[self initWithFrame:...]`. - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { From b53ab8a85c1ebd395e2a4e618429408693e0021e Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Sat, 17 Jun 2017 13:48:10 -0400 Subject: [PATCH 5/5] [SSK] Respond to post-holiday code reviews. // FREEBIE --- Podfile | 4 ++-- Podfile.lock | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Podfile b/Podfile index a33208ad26..64c1915dc1 100644 --- a/Podfile +++ b/Podfile @@ -5,8 +5,8 @@ target 'Signal' do pod 'SocketRocket', :git => 'https://github.com/facebook/SocketRocket.git' pod 'AxolotlKit', git: 'https://github.com/WhisperSystems/SignalProtocolKit.git' #pod 'AxolotlKit', path: '../SignalProtocolKit' - #pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git' - pod 'SignalServiceKit', path: '../SignalServiceKit' + pod 'SignalServiceKit', git: 'https://github.com/WhisperSystems/SignalServiceKit.git' + #pod 'SignalServiceKit', path: '../SignalServiceKit' pod 'JSQMessagesViewController', git: 'https://github.com/WhisperSystems/JSQMessagesViewController.git', branch: 'mkirk/position-edit-menu' #pod 'JSQMessagesViewController' path: '../JSQMessagesViewController' pod 'PureLayout' diff --git a/Podfile.lock b/Podfile.lock index a26c971913..6daea6cb5f 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -112,7 +112,7 @@ DEPENDENCIES: - JSQMessagesViewController (from `https://github.com/WhisperSystems/JSQMessagesViewController.git`, branch `mkirk/position-edit-menu`) - PureLayout - Reachability - - SignalServiceKit (from `../SignalServiceKit`) + - SignalServiceKit (from `https://github.com/WhisperSystems/SignalServiceKit.git`) - SocketRocket (from `https://github.com/facebook/SocketRocket.git`) EXTERNAL SOURCES: @@ -122,7 +122,7 @@ EXTERNAL SOURCES: :branch: mkirk/position-edit-menu :git: https://github.com/WhisperSystems/JSQMessagesViewController.git SignalServiceKit: - :path: ../SignalServiceKit + :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :git: https://github.com/facebook/SocketRocket.git @@ -133,6 +133,9 @@ CHECKOUT OPTIONS: JSQMessagesViewController: :commit: 7054e4b13ee5bcd6d524adb6dc9a726e8c466308 :git: https://github.com/WhisperSystems/JSQMessagesViewController.git + SignalServiceKit: + :commit: c0cb153f29e0102355c01273570115217bb0454f + :git: https://github.com/WhisperSystems/SignalServiceKit.git SocketRocket: :commit: 877ac7438be3ad0b45ef5ca3969574e4b97112bf :git: https://github.com/facebook/SocketRocket.git @@ -158,6 +161,6 @@ SPEC CHECKSUMS: UnionFind: c33be5adb12983981d6e827ea94fc7f9e370f52d YapDatabase: cd911121580ff16675f65ad742a9eb0ab4d9e266 -PODFILE CHECKSUM: 6e5d90a9603eb043b395213fd8a29037d2276a8f +PODFILE CHECKSUM: 89fd7aee1e2b0ca592ecc9dba0389e57b70f959b COCOAPODS: 1.2.1