From d6d16ed162460858886718667283fbb935c8b1df Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 11:31:55 -0400 Subject: [PATCH 01/10] "Bump build to 2.28.1.0." --- Signal/Signal-Info.plist | 4 ++-- SignalShareExtension/Info.plist | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index cd17c4326..3a8fc7b8f 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.28.0 + 2.28.1 CFBundleSignature ???? CFBundleURLTypes @@ -38,7 +38,7 @@ CFBundleVersion - 2.28.0.15 + 2.28.1.0 ITSAppUsesNonExemptEncryption LOGS_EMAIL diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index 4727a5757..b3d7a33f5 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 2.28.0 + 2.28.1 CFBundleVersion - 2.28.0.15 + 2.28.1.0 ITSAppUsesNonExemptEncryption NSAppTransportSecurity From ea765437ef52e86f3f35ee421cde843d20c6fc31 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 10:25:22 -0400 Subject: [PATCH 02/10] Improve date formatting perf. --- Signal/src/util/DateUtil.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Signal/src/util/DateUtil.m b/Signal/src/util/DateUtil.m index ad9c954bf..9f74a0195 100644 --- a/Signal/src/util/DateUtil.m +++ b/Signal/src/util/DateUtil.m @@ -259,14 +259,20 @@ static NSString *const DATE_FORMAT_WEEKDAY = @"EEEE"; + (NSString *)formatDateShort:(NSDate *)date { + OWSAssertIsOnMainThread(); OWSAssert(date); + NSDate *now = [NSDate date]; + NSInteger dayDifference = [self daysFromFirstDate:date toSecondDate:now]; + BOOL dateIsOlderThanToday = dayDifference > 0; + BOOL dateIsOlderThanOneWeek = dayDifference > 6; + NSString *dateTimeString; if (![DateUtil dateIsThisYear:date]) { dateTimeString = [[DateUtil dateFormatter] stringFromDate:date]; - } else if ([DateUtil dateIsOlderThanOneWeek:date]) { + } else if (dateIsOlderThanOneWeek) { dateTimeString = [[DateUtil monthAndDayFormatter] stringFromDate:date]; - } else if ([DateUtil dateIsOlderThanToday:date]) { + } else if (dateIsOlderThanToday) { dateTimeString = [[DateUtil shortDayOfWeekFormatter] stringFromDate:date]; } else { dateTimeString = [[DateUtil timeFormatter] stringFromDate:date]; From 21c630c0958fa072ee960ab7d8037929dd2bb257 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 10:25:38 -0400 Subject: [PATCH 03/10] Ignore redundant body text view updates; cache body text view size. --- .../Cells/OWSMessageTextView.m | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageTextView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageTextView.m index f2dd320e5..5626d0a8a 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageTextView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageTextView.m @@ -7,6 +7,14 @@ NS_ASSUME_NONNULL_BEGIN +@interface OWSMessageTextView () + +@property (nonatomic, nullable) NSValue *cachedSize; + +@end + +#pragma mark - + @implementation OWSMessageTextView // Our message text views are never used for editing; @@ -61,6 +69,61 @@ NS_ASSUME_NONNULL_BEGIN return result; } +- (void)setText:(nullable NSString *)text +{ + if ([NSObject isNullableObject:text equalTo:self.text]) { + return; + } + [super setText:text]; + self.cachedSize = nil; +} + +- (void)setAttributedText:(nullable NSAttributedString *)attributedText +{ + if ([NSObject isNullableObject:attributedText equalTo:self.attributedText]) { + return; + } + [super setAttributedText:attributedText]; + self.cachedSize = nil; +} + +- (void)setTextColor:(nullable UIColor *)textColor +{ + if ([NSObject isNullableObject:textColor equalTo:self.textColor]) { + return; + } + [super setTextColor:textColor]; + self.cachedSize = nil; +} + +- (void)setFont:(nullable UIFont *)font +{ + if ([NSObject isNullableObject:font equalTo:self.font]) { + return; + } + [super setFont:font]; + self.cachedSize = nil; +} + +- (void)setLinkTextAttributes:(nullable NSDictionary *)linkTextAttributes +{ + if ([NSObject isNullableObject:linkTextAttributes equalTo:self.linkTextAttributes]) { + return; + } + [super setLinkTextAttributes:linkTextAttributes]; + self.cachedSize = nil; +} + +- (CGSize)sizeThatFits:(CGSize)size +{ + if (self.cachedSize) { + return self.cachedSize.CGSizeValue; + } + CGSize result = [super sizeThatFits:size]; + self.cachedSize = [NSValue valueWithCGSize:result]; + return result; +} + @end NS_ASSUME_NONNULL_END From 4d2bdf9bd0b019822d8f24995a27838bd018e141 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 13:33:35 -0400 Subject: [PATCH 04/10] Respond to CR. --- .../ViewControllers/ConversationView/Cells/OWSMessageTextView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageTextView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageTextView.m index 5626d0a8a..2ac36ade5 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageTextView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageTextView.m @@ -93,7 +93,7 @@ NS_ASSUME_NONNULL_BEGIN return; } [super setTextColor:textColor]; - self.cachedSize = nil; + // No need to clear cached size here. } - (void)setFont:(nullable UIFont *)font From 991848b364c2bfb24ca0349dffe7ab6f4a24e9c1 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 3 Aug 2018 12:35:06 -0600 Subject: [PATCH 05/10] Fix "blue navbar" for contact picker - content flows behind navbar - unify search bar style with rest of app // FREEBIE --- Signal.xcodeproj/project.pbxproj | 4 -- .../src/ViewControllers/ContactsPicker.swift | 35 ++++++++--- Signal/src/ViewControllers/ContactsPicker.xib | 59 ------------------- 3 files changed, 26 insertions(+), 72 deletions(-) delete mode 100644 Signal/src/ViewControllers/ContactsPicker.xib diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index f302588cc..1748c937c 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -175,7 +175,6 @@ 34B0796D1FCF46B100E248C2 /* MainAppContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B0796B1FCF46B000E248C2 /* MainAppContext.m */; }; 34B3F8751E8DF1700035BE1A /* CallViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F83B1E8DF1700035BE1A /* CallViewController.swift */; }; 34B3F8771E8DF1700035BE1A /* ContactsPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F83E1E8DF1700035BE1A /* ContactsPicker.swift */; }; - 34B3F8781E8DF1700035BE1A /* ContactsPicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34B3F83F1E8DF1700035BE1A /* ContactsPicker.xib */; }; 34B3F87B1E8DF1700035BE1A /* ExperienceUpgradesPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8441E8DF1700035BE1A /* ExperienceUpgradesPageViewController.swift */; }; 34B3F8801E8DF1700035BE1A /* InviteFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */; }; 34B3F8821E8DF1700035BE1A /* NewContactThreadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34B3F8501E8DF1700035BE1A /* NewContactThreadViewController.m */; }; @@ -804,7 +803,6 @@ 34B3F83A1E8DF1700035BE1A /* AttachmentSharing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AttachmentSharing.m; sourceTree = ""; }; 34B3F83B1E8DF1700035BE1A /* CallViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallViewController.swift; sourceTree = ""; }; 34B3F83E1E8DF1700035BE1A /* ContactsPicker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContactsPicker.swift; sourceTree = ""; }; - 34B3F83F1E8DF1700035BE1A /* ContactsPicker.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContactsPicker.xib; sourceTree = ""; }; 34B3F8441E8DF1700035BE1A /* ExperienceUpgradesPageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExperienceUpgradesPageViewController.swift; sourceTree = ""; }; 34B3F84C1E8DF1700035BE1A /* InviteFlow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InviteFlow.swift; sourceTree = ""; }; 34B3F84F1E8DF1700035BE1A /* NewContactThreadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewContactThreadViewController.h; sourceTree = ""; }; @@ -1680,7 +1678,6 @@ 34B3F83B1E8DF1700035BE1A /* CallViewController.swift */, 348BB25C20A0C5530047AEC2 /* ContactShareViewHelper.swift */, 34B3F83E1E8DF1700035BE1A /* ContactsPicker.swift */, - 34B3F83F1E8DF1700035BE1A /* ContactsPicker.xib */, 34E88D252098C5AE00A608F4 /* ContactViewController.swift */, 3448BFC01EDF0EA7005B2D69 /* ConversationView */, 346B66301F4E29B200E5122F /* CropScaleImageViewController.swift */, @@ -2778,7 +2775,6 @@ AD83FF431A73426500B5C81A /* audio_play_button@2x.png in Resources */, 34661FB820C1C0D60056EDD6 /* message_sent.aiff in Resources */, 45CB2FA81CB7146C00E1B343 /* Launch Screen.storyboard in Resources */, - 34B3F8781E8DF1700035BE1A /* ContactsPicker.xib in Resources */, B633C5C31A1D190B0059AC12 /* mute_off@2x.png in Resources */, AD83FF411A73426500B5C81A /* audio_play_button_blue@2x.png in Resources */, 34C3C78D20409F320000134C /* Opening.m4r in Resources */, diff --git a/Signal/src/ViewControllers/ContactsPicker.swift b/Signal/src/ViewControllers/ContactsPicker.swift index fbd920cbb..f13dc76b8 100644 --- a/Signal/src/ViewControllers/ContactsPicker.swift +++ b/Signal/src/ViewControllers/ContactsPicker.swift @@ -28,12 +28,11 @@ public enum SubtitleCellValue: Int { @objc public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate { - @IBOutlet var tableView: UITableView! - @IBOutlet var searchBar: UISearchBar! + var tableView: UITableView! + var searchBar: UISearchBar! // MARK: - Properties - private let TAG = "[ContactsPicker]" private let contactCellReuseIdentifier = "contactCellReuseIdentifier" private var contactsManager: OWSContactsManager { @@ -84,7 +83,7 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView required public init(allowsMultipleSelection: Bool, subtitleCellType: SubtitleCellValue) { self.allowsMultipleSelection = allowsMultipleSelection self.subtitleCellType = subtitleCellType - super.init(nibName: "ContactsPicker", bundle: nil) + super.init(nibName: nil, bundle: nil) } required public init?(coder aDecoder: NSCoder) { @@ -93,12 +92,30 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView // MARK: - Lifecycle Methods + override public func loadView() { + self.view = UIView() + let tableView = UITableView() + self.tableView = tableView + + view.addSubview(tableView) + tableView.autoPinEdgesToSuperviewEdges() + tableView.delegate = self + tableView.dataSource = self + + let searchBar = UISearchBar() + self.searchBar = searchBar + searchBar.searchBarStyle = .minimal + searchBar.delegate = self + searchBar.backgroundColor = .white + searchBar.sizeToFit() + + tableView.tableHeaderView = searchBar + } + override open func viewDidLoad() { super.viewDidLoad() searchBar.placeholder = NSLocalizedString("INVITE_FRIENDS_PICKER_SEARCHBAR_PLACEHOLDER", comment: "Search") - // Prevent content from going under the navigation bar - self.edgesForExtendedLayout = [] // Auto size cells for dynamic type tableView.estimatedRowHeight = 60.0 @@ -140,7 +157,7 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView private func reloadContacts() { getContacts( onError: { error in - Logger.error("\(self.TAG) failed to reload contacts with error:\(error)") + Logger.error("\(self.logTag) failed to reload contacts with error:\(error)") }) } @@ -192,7 +209,7 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView } self.sections = collatedContacts(contacts) } catch let error as NSError { - Logger.error("\(self.TAG) Failed to fetch contacts with error:\(error)") + Logger.error("\(self.logTag) Failed to fetch contacts with error:\(error)") } } } @@ -331,7 +348,7 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView let filteredContacts = try contactStore.unifiedContacts(matching: predicate, keysToFetch: allowedContactKeys) filteredSections = collatedContacts(filteredContacts) } catch let error as NSError { - Logger.error("\(self.TAG) updating search results failed with error: \(error)") + Logger.error("\(self.logTag) updating search results failed with error: \(error)") } } self.tableView.reloadData() diff --git a/Signal/src/ViewControllers/ContactsPicker.xib b/Signal/src/ViewControllers/ContactsPicker.xib deleted file mode 100644 index a78eca718..000000000 --- a/Signal/src/ViewControllers/ContactsPicker.xib +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From dbbccaadbe1ffa95cf9536332791e3192a198bad Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 3 Aug 2018 12:37:16 -0600 Subject: [PATCH 06/10] fixup block table vis a new navbar style // FREEBIE --- .../ViewControllers/AppSettings/BlockListViewController.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Signal/src/ViewControllers/AppSettings/BlockListViewController.m b/Signal/src/ViewControllers/AppSettings/BlockListViewController.m index c2bdb4c75..cf79fa624 100644 --- a/Signal/src/ViewControllers/AppSettings/BlockListViewController.m +++ b/Signal/src/ViewControllers/AppSettings/BlockListViewController.m @@ -40,9 +40,8 @@ NS_ASSUME_NONNULL_BEGIN _tableViewController = [OWSTableViewController new]; [self.view addSubview:self.tableViewController.view]; - [_tableViewController.view autoPinWidthToSuperview]; - [_tableViewController.view autoPinToTopLayoutGuideOfViewController:self withInset:0]; - [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; + [self addChildViewController:self.tableViewController]; + [_tableViewController.view autoPinEdgesToSuperviewEdges]; self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension; self.tableViewController.tableView.estimatedRowHeight = 60; From 251eef46a20dc9eb33492dfabe23aa1b391df0cb Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 10:26:37 -0400 Subject: [PATCH 07/10] Delay footer collapse in new messages. --- .../ConversationViewController.m | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index d7fdf01ee..794adc62d 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -235,6 +235,7 @@ typedef enum : NSUInteger { @property (nonatomic) ContactShareViewHelper *contactShareViewHelper; @property (nonatomic) NSTimer *reloadTimer; @property (nonatomic, nullable) NSDate *lastReloadDate; +@property (nonatomic, nullable) NSDate *collapseCutoffDate; @end @@ -447,6 +448,7 @@ typedef enum : NSUInteger { // Cache the cell media for ~24 cells. self.cellMediaCache.countLimit = 24; _conversationStyle = [[ConversationStyle alloc] initWithThread:thread]; + self.collapseCutoffDate = [NSDate new]; // We need to update the "unread indicator" _before_ we determine the initial range // size, since it depends on where the unread indicator is placed. @@ -818,9 +820,11 @@ typedef enum : NSUInteger { - (void)resetContentAndLayout { // Avoid layout corrupt issues and out-of-date message subtitles. + self.lastReloadDate = [NSDate new]; + self.collapseCutoffDate = [NSDate new]; + [self reloadViewItems]; [self.collectionView.collectionViewLayout invalidateLayout]; [self.collectionView reloadData]; - self.lastReloadDate = [NSDate new]; } - (void)setUserHasScrolled:(BOOL)userHasScrolled @@ -3384,9 +3388,10 @@ typedef enum : NSUInteger { // These errors seems to be very rare; they can only be reproduced // using the more extreme actions in the debug UI. OWSProdLogAndFail(@"%@ hasMalformedRowChange", self.logTag); + self.lastReloadDate = [NSDate new]; + self.collapseCutoffDate = [NSDate new]; [self reloadViewItems]; [self.collectionView reloadData]; - self.lastReloadDate = [NSDate new]; [self updateLastVisibleTimestamp]; return; } @@ -4349,9 +4354,11 @@ typedef enum : NSUInteger { - (void)conversationColorWasUpdated { [self.conversationStyle updateProperties]; + self.collapseCutoffDate = [NSDate new]; + self.lastReloadDate = [NSDate new]; + [self reloadViewItems]; [self.headerView updateAvatar]; [self.collectionView reloadData]; - self.lastReloadDate = [NSDate new]; } - (void)groupWasUpdated:(TSGroupModel *)groupModel @@ -4862,6 +4869,8 @@ typedef enum : NSUInteger { BOOL shouldShowDateOnNextViewItem = YES; uint64_t previousViewItemTimestamp = 0; OWSUnreadIndicator *_Nullable unreadIndicator = self.dynamicInteractions.unreadIndicator; + uint64_t collapseCutoffTimestamp = [NSDate ows_millisecondsSince1970ForDate:self.collapseCutoffDate]; + BOOL hasPlacedUnreadIndicator = NO; for (ConversationViewItem *viewItem in viewItems) { BOOL canShowDate = NO; @@ -5071,6 +5080,10 @@ typedef enum : NSUInteger { } } + if (viewItem.interaction.timestampForSorting > collapseCutoffTimestamp) { + shouldHideFooter = NO; + } + viewItem.isFirstInCluster = isFirstInCluster; viewItem.isLastInCluster = isLastInCluster; viewItem.shouldShowSenderAvatar = shouldShowSenderAvatar; From 95cf4f5c6db4d5e0773dc3122a23e0bc49219222 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 10:25:56 -0400 Subject: [PATCH 08/10] Don't reserve space for timestamp in footer. --- .../Cells/OWSMessageFooterView.m | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m index dba52699d..73effa78d 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageFooterView.m @@ -228,29 +228,6 @@ NS_ASSUME_NONNULL_BEGIN // Measure the actual current width, to be safe. CGFloat timestampLabelWidth = [self.timestampLabel sizeThatFits:CGSizeZero].width; - // Measuring the timestamp label's width is non-trivial since its - // contents can be relative the current time. We avoid having - // message bubbles' "visually vibrate" as their timestamp labels - // vary in width. So we try to leave enough space for all possible - // contents of this label _for the first hour of its lifetime_, when - // the timestamp is particularly volatile. - if ([DateUtil isTimestampFromLastHour:viewItem.interaction.timestamp]) { - // Measure the "now" case. - self.timestampLabel.text = [DateUtil exemplaryNowTimeFormat]; - timestampLabelWidth = MAX(timestampLabelWidth, [self.timestampLabel sizeThatFits:CGSizeZero].width); - // Measure the "relative time" case. - // Since this case varies with time, we multiply to leave - // space for the worst case (whose exact value, due to localization, - // is unpredictable). - self.timestampLabel.text = [DateUtil exemplaryMinutesTimeFormat]; - timestampLabelWidth = MAX(timestampLabelWidth, - [self.timestampLabel sizeThatFits:CGSizeZero].width + self.timestampLabel.font.lineHeight * 0.5f); - - // Re-configure the labels with the current appropriate value in case - // we are configuring this view for display. - [self configureLabelsWithConversationViewItem:viewItem]; - } - result.width = timestampLabelWidth; if (viewItem.interaction.interactionType == OWSInteractionType_OutgoingMessage) { if (![self isFailedOutgoingMessage:viewItem]) { From 4918b8994ef772a02b3c6af14841a4b3516b91d8 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 13:10:11 -0400 Subject: [PATCH 09/10] Delay footer collapse in new messages. --- .../ConversationViewController.m | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 794adc62d..b7b70fcd1 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -448,7 +448,6 @@ typedef enum : NSUInteger { // Cache the cell media for ~24 cells. self.cellMediaCache.countLimit = 24; _conversationStyle = [[ConversationStyle alloc] initWithThread:thread]; - self.collapseCutoffDate = [NSDate new]; // We need to update the "unread indicator" _before_ we determine the initial range // size, since it depends on where the unread indicator is placed. @@ -724,6 +723,8 @@ typedef enum : NSUInteger { [self updateBarButtonItems]; [self updateNavigationTitle]; + [self resetContentAndLayout]; + // We want to set the initial scroll state the first time we enter the view. if (!self.viewHasEverAppeared) { [self scrollToDefaultPosition]; @@ -821,7 +822,6 @@ typedef enum : NSUInteger { { // Avoid layout corrupt issues and out-of-date message subtitles. self.lastReloadDate = [NSDate new]; - self.collapseCutoffDate = [NSDate new]; [self reloadViewItems]; [self.collectionView.collectionViewLayout invalidateLayout]; [self.collectionView reloadData]; @@ -3388,11 +3388,9 @@ typedef enum : NSUInteger { // These errors seems to be very rare; they can only be reproduced // using the more extreme actions in the debug UI. OWSProdLogAndFail(@"%@ hasMalformedRowChange", self.logTag); - self.lastReloadDate = [NSDate new]; - self.collapseCutoffDate = [NSDate new]; - [self reloadViewItems]; - [self.collectionView reloadData]; + [self resetContentAndLayout]; [self updateLastVisibleTimestamp]; + [self scrollToBottomAnimated:NO]; return; } @@ -4354,11 +4352,8 @@ typedef enum : NSUInteger { - (void)conversationColorWasUpdated { [self.conversationStyle updateProperties]; - self.collapseCutoffDate = [NSDate new]; - self.lastReloadDate = [NSDate new]; - [self reloadViewItems]; [self.headerView updateAvatar]; - [self.collectionView reloadData]; + [self resetContentAndLayout]; } - (void)groupWasUpdated:(TSGroupModel *)groupModel @@ -4825,6 +4820,8 @@ typedef enum : NSUInteger { // cell view models. - (void)reloadViewItems { + self.collapseCutoffDate = [NSDate new]; + NSMutableArray *viewItems = [NSMutableArray new]; NSMutableDictionary *viewItemCache = [NSMutableDictionary new]; From c8f33e4fc6264b32663f324e8a6fe552b264ca02 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Aug 2018 15:58:42 -0400 Subject: [PATCH 10/10] "Bump build to 2.28.1.1." --- 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 3a8fc7b8f..933bd08bf 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -38,7 +38,7 @@ CFBundleVersion - 2.28.1.0 + 2.28.1.1 ITSAppUsesNonExemptEncryption LOGS_EMAIL diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index b3d7a33f5..aa027eadc 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 2.28.1 CFBundleVersion - 2.28.1.0 + 2.28.1.1 ITSAppUsesNonExemptEncryption NSAppTransportSecurity