From eda7d6b4581b563016c5d715dcd39cacc4b04ce8 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 5 Dec 2018 14:13:26 -0500 Subject: [PATCH 1/8] Update 'tags to ignore.' --- Scripts/reverse_integration_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Scripts/reverse_integration_check.py b/Scripts/reverse_integration_check.py index 01bdf6b50..f7f5967c5 100755 --- a/Scripts/reverse_integration_check.py +++ b/Scripts/reverse_integration_check.py @@ -52,6 +52,7 @@ def main(): '2.29.0.11', '2.30.0.0', '2.30.0.1', + '2.30.2.0', '3.0', '3.0.1', '3.0.2', From 4f0fa23c4ffdfb456d2f6a36750c44c6245a280e Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 5 Dec 2018 14:10:08 -0500 Subject: [PATCH 2/8] Don't ever show TI when they are disabled. --- SignalServiceKit/src/Util/TypingIndicators.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SignalServiceKit/src/Util/TypingIndicators.swift b/SignalServiceKit/src/Util/TypingIndicators.swift index 97b721391..f148a7555 100644 --- a/SignalServiceKit/src/Util/TypingIndicators.swift +++ b/SignalServiceKit/src/Util/TypingIndicators.swift @@ -159,6 +159,10 @@ public class TypingIndicatorsImpl: NSObject, TypingIndicators { public func typingRecipientId(forThread thread: TSThread) -> String? { AssertIsOnMainThread() + guard areTypingIndicatorsEnabled() else { + return nil + } + var firstRecipientId: String? var firstTimestamp: UInt64? From b0bd0ecb3b9a1adea205b8d687717da25640fd24 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 5 Dec 2018 16:43:20 -0500 Subject: [PATCH 3/8] "Bump build to 2.32.0.20." --- Signal/Signal-Info.plist | 2 +- SignalShareExtension/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 3f6ee4e90..ffe6f6419 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -49,7 +49,7 @@ CFBundleVersion - 2.32.0.19 + 2.32.0.20 ITSAppUsesNonExemptEncryption LOGS_EMAIL diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index 83ed2f7dd..38116d48b 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 2.32.0 CFBundleVersion - 2.32.0.19 + 2.32.0.20 ITSAppUsesNonExemptEncryption NSAppTransportSecurity From 3d9e27ff646345f04a6a36680c5decc90d2a7917 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 5 Dec 2018 16:43:24 -0500 Subject: [PATCH 4/8] "Bump build to 2.32.0.21." --- Signal/Signal-Info.plist | 2 +- SignalShareExtension/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index ffe6f6419..40001d677 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -49,7 +49,7 @@ CFBundleVersion - 2.32.0.20 + 2.32.0.21 ITSAppUsesNonExemptEncryption LOGS_EMAIL diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index 38116d48b..98ad36eb5 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 2.32.0 CFBundleVersion - 2.32.0.20 + 2.32.0.21 ITSAppUsesNonExemptEncryption NSAppTransportSecurity From 542360739329db248e3ad20f205a999334762048 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 6 Dec 2018 19:12:16 -0500 Subject: [PATCH 5/8] debug logging --- .../src/Messages/Attachments/TSAttachmentStream.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m b/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m index c5e70b384..15c4d2055 100644 --- a/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m +++ b/SignalServiceKit/src/Messages/Attachments/TSAttachmentStream.m @@ -192,7 +192,7 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail); OWSFailDebug(@"Missing path for attachment."); return NO; } - OWSLogInfo(@"Writing attachment to file: %@", filePath); + OWSLogDebug(@"Writing attachment to file: %@", filePath); return [data writeToFile:filePath options:0 error:error]; } @@ -205,7 +205,7 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail); OWSFailDebug(@"Missing path for attachment."); return NO; } - OWSLogInfo(@"Writing attachment to file: %@", filePath); + OWSLogDebug(@"Writing attachment to file: %@", filePath); return [dataSource writeToPath:filePath]; } From 34737567c2c57a9fad5bbf38617a1c3eb66b6443 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 6 Dec 2018 19:03:28 -0500 Subject: [PATCH 6/8] fix voice over for settings bar button item --- .../HomeView/HomeViewController.m | 18 +++--- SignalMessaging/Views/AvatarImageView.swift | 56 +++++++++++++++++++ 2 files changed, 66 insertions(+), 8 deletions(-) diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index f0d49cc5c..6967fd679 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -504,14 +504,16 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations UIImage *avatarImage = (localProfileAvatarImage ?: [[[OWSContactAvatarBuilder alloc] initForLocalUserWithDiameter:kAvatarSize] buildDefaultImage]); OWSAssertDebug(avatarImage); - AvatarImageView *avatarView = [[AvatarImageView alloc] initWithImage:avatarImage]; - [avatarView autoSetDimension:ALDimensionWidth toSize:kAvatarSize]; - [avatarView autoSetDimension:ALDimensionHeight toSize:kAvatarSize]; - avatarView.userInteractionEnabled = YES; - [avatarView - addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self - action:@selector(settingsButtonPressed:)]]; - settingsButton = [[UIBarButtonItem alloc] initWithCustomView:avatarView]; + + UIButton *avatarButton = [AvatarImageButton buttonWithType:UIButtonTypeCustom]; + [avatarButton addTarget:self + action:@selector(settingsButtonPressed:) + forControlEvents:UIControlEventTouchUpInside]; + [avatarButton setImage:avatarImage forState:UIControlStateNormal]; + [avatarButton autoSetDimension:ALDimensionWidth toSize:kAvatarSize]; + [avatarButton autoSetDimension:ALDimensionHeight toSize:kAvatarSize]; + + settingsButton = [[UIBarButtonItem alloc] initWithCustomView:avatarButton]; } else { // iOS 9 and 10 have a bug around layout of custom views in UIBarButtonItem, // so we just use a simple icon. diff --git a/SignalMessaging/Views/AvatarImageView.swift b/SignalMessaging/Views/AvatarImageView.swift index 62dd476c8..d4d4eb248 100644 --- a/SignalMessaging/Views/AvatarImageView.swift +++ b/SignalMessaging/Views/AvatarImageView.swift @@ -178,3 +178,59 @@ public class ConversationAvatarImageView: AvatarImageView { self.image = OWSAvatarBuilder.buildImage(thread: thread, diameter: diameter) } } + +@objc +public class AvatarImageButton: UIButton { + private let shadowLayer = CAShapeLayer() + + // MARK: - Button Overrides + + override public func layoutSubviews() { + super.layoutSubviews() + + layer.cornerRadius = frame.size.width / 2 + + // Inner shadow. + // This should usually not be visible; it is used to distinguish + // profile pics from the background if they are similar. + shadowLayer.frame = bounds + shadowLayer.masksToBounds = true + let shadowBounds = bounds + let shadowPath = UIBezierPath(ovalIn: shadowBounds) + // This can be any value large enough to cast a sufficiently large shadow. + let shadowInset: CGFloat = -3 + shadowPath.append(UIBezierPath(rect: shadowBounds.insetBy(dx: shadowInset, dy: shadowInset))) + // This can be any color since the fill should be clipped. + shadowLayer.fillColor = UIColor.black.cgColor + shadowLayer.path = shadowPath.cgPath + shadowLayer.fillRule = kCAFillRuleEvenOdd + shadowLayer.shadowColor = (Theme.isDarkThemeEnabled ? UIColor.white : UIColor.black).cgColor + shadowLayer.shadowRadius = 0.5 + shadowLayer.shadowOpacity = 0.15 + shadowLayer.shadowOffset = .zero + } + + override public func setImage(_ image: UIImage?, for state: UIControlState) { + ensureViewConfigured() + super.setImage(image, for: state) + } + + // MARK: Private + + var hasBeenConfigured = false + func ensureViewConfigured() { + guard !hasBeenConfigured else { + return + } + hasBeenConfigured = true + + autoPinToSquareAspectRatio() + + layer.minificationFilter = kCAFilterTrilinear + layer.magnificationFilter = kCAFilterTrilinear + layer.masksToBounds = true + layer.addSublayer(shadowLayer) + + contentMode = .scaleToFill + } +} From e834550649d191c5b6e63de7ce384d66f0568940 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 6 Dec 2018 18:23:53 -0500 Subject: [PATCH 7/8] ensure layout invalidated after leaving media landscape --- .../ConversationView/ConversationViewController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 339badae1..44a494465 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -4163,6 +4163,7 @@ typedef enum : NSUInteger { [self updateLastVisibleTimestamp]; self.conversationStyle.viewWidth = self.collectionView.width; + [self.collectionView.collectionViewLayout invalidateLayout]; } #pragma mark - View Items From 973390099a9e4714087386a8916ad4f25f94748a Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 6 Dec 2018 19:51:50 -0500 Subject: [PATCH 8/8] "Bump build to 2.32.0.22." --- Signal/Signal-Info.plist | 2 +- SignalShareExtension/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 40001d677..965b8ec3d 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -49,7 +49,7 @@ CFBundleVersion - 2.32.0.21 + 2.32.0.22 ITSAppUsesNonExemptEncryption LOGS_EMAIL diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index 98ad36eb5..a47e33e09 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 2.32.0 CFBundleVersion - 2.32.0.21 + 2.32.0.22 ITSAppUsesNonExemptEncryption NSAppTransportSecurity