|
|
@ -235,6 +235,7 @@ typedef enum : NSUInteger {
|
|
|
|
@property (nonatomic) ContactShareViewHelper *contactShareViewHelper;
|
|
|
|
@property (nonatomic) ContactShareViewHelper *contactShareViewHelper;
|
|
|
|
@property (nonatomic) NSTimer *reloadTimer;
|
|
|
|
@property (nonatomic) NSTimer *reloadTimer;
|
|
|
|
@property (nonatomic, nullable) NSDate *lastReloadDate;
|
|
|
|
@property (nonatomic, nullable) NSDate *lastReloadDate;
|
|
|
|
|
|
|
|
@property (nonatomic, nullable) NSDate *collapseCutoffDate;
|
|
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
@ -722,6 +723,8 @@ typedef enum : NSUInteger {
|
|
|
|
[self updateBarButtonItems];
|
|
|
|
[self updateBarButtonItems];
|
|
|
|
[self updateNavigationTitle];
|
|
|
|
[self updateNavigationTitle];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[self resetContentAndLayout];
|
|
|
|
|
|
|
|
|
|
|
|
// We want to set the initial scroll state the first time we enter the view.
|
|
|
|
// We want to set the initial scroll state the first time we enter the view.
|
|
|
|
if (!self.viewHasEverAppeared) {
|
|
|
|
if (!self.viewHasEverAppeared) {
|
|
|
|
[self scrollToDefaultPosition];
|
|
|
|
[self scrollToDefaultPosition];
|
|
|
@ -818,9 +821,10 @@ typedef enum : NSUInteger {
|
|
|
|
- (void)resetContentAndLayout
|
|
|
|
- (void)resetContentAndLayout
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Avoid layout corrupt issues and out-of-date message subtitles.
|
|
|
|
// Avoid layout corrupt issues and out-of-date message subtitles.
|
|
|
|
|
|
|
|
self.lastReloadDate = [NSDate new];
|
|
|
|
|
|
|
|
[self reloadViewItems];
|
|
|
|
[self.collectionView.collectionViewLayout invalidateLayout];
|
|
|
|
[self.collectionView.collectionViewLayout invalidateLayout];
|
|
|
|
[self.collectionView reloadData];
|
|
|
|
[self.collectionView reloadData];
|
|
|
|
self.lastReloadDate = [NSDate new];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)setUserHasScrolled:(BOOL)userHasScrolled
|
|
|
|
- (void)setUserHasScrolled:(BOOL)userHasScrolled
|
|
|
@ -3384,10 +3388,9 @@ typedef enum : NSUInteger {
|
|
|
|
// These errors seems to be very rare; they can only be reproduced
|
|
|
|
// These errors seems to be very rare; they can only be reproduced
|
|
|
|
// using the more extreme actions in the debug UI.
|
|
|
|
// using the more extreme actions in the debug UI.
|
|
|
|
OWSProdLogAndFail(@"%@ hasMalformedRowChange", self.logTag);
|
|
|
|
OWSProdLogAndFail(@"%@ hasMalformedRowChange", self.logTag);
|
|
|
|
[self reloadViewItems];
|
|
|
|
[self resetContentAndLayout];
|
|
|
|
[self.collectionView reloadData];
|
|
|
|
|
|
|
|
self.lastReloadDate = [NSDate new];
|
|
|
|
|
|
|
|
[self updateLastVisibleTimestamp];
|
|
|
|
[self updateLastVisibleTimestamp];
|
|
|
|
|
|
|
|
[self scrollToBottomAnimated:NO];
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -4350,8 +4353,7 @@ typedef enum : NSUInteger {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[self.conversationStyle updateProperties];
|
|
|
|
[self.conversationStyle updateProperties];
|
|
|
|
[self.headerView updateAvatar];
|
|
|
|
[self.headerView updateAvatar];
|
|
|
|
[self.collectionView reloadData];
|
|
|
|
[self resetContentAndLayout];
|
|
|
|
self.lastReloadDate = [NSDate new];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)groupWasUpdated:(TSGroupModel *)groupModel
|
|
|
|
- (void)groupWasUpdated:(TSGroupModel *)groupModel
|
|
|
@ -4818,6 +4820,8 @@ typedef enum : NSUInteger {
|
|
|
|
// cell view models.
|
|
|
|
// cell view models.
|
|
|
|
- (void)reloadViewItems
|
|
|
|
- (void)reloadViewItems
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
self.collapseCutoffDate = [NSDate new];
|
|
|
|
|
|
|
|
|
|
|
|
NSMutableArray<ConversationViewItem *> *viewItems = [NSMutableArray new];
|
|
|
|
NSMutableArray<ConversationViewItem *> *viewItems = [NSMutableArray new];
|
|
|
|
NSMutableDictionary<NSString *, ConversationViewItem *> *viewItemCache = [NSMutableDictionary new];
|
|
|
|
NSMutableDictionary<NSString *, ConversationViewItem *> *viewItemCache = [NSMutableDictionary new];
|
|
|
|
|
|
|
|
|
|
|
@ -4862,6 +4866,8 @@ typedef enum : NSUInteger {
|
|
|
|
BOOL shouldShowDateOnNextViewItem = YES;
|
|
|
|
BOOL shouldShowDateOnNextViewItem = YES;
|
|
|
|
uint64_t previousViewItemTimestamp = 0;
|
|
|
|
uint64_t previousViewItemTimestamp = 0;
|
|
|
|
OWSUnreadIndicator *_Nullable unreadIndicator = self.dynamicInteractions.unreadIndicator;
|
|
|
|
OWSUnreadIndicator *_Nullable unreadIndicator = self.dynamicInteractions.unreadIndicator;
|
|
|
|
|
|
|
|
uint64_t collapseCutoffTimestamp = [NSDate ows_millisecondsSince1970ForDate:self.collapseCutoffDate];
|
|
|
|
|
|
|
|
|
|
|
|
BOOL hasPlacedUnreadIndicator = NO;
|
|
|
|
BOOL hasPlacedUnreadIndicator = NO;
|
|
|
|
for (ConversationViewItem *viewItem in viewItems) {
|
|
|
|
for (ConversationViewItem *viewItem in viewItems) {
|
|
|
|
BOOL canShowDate = NO;
|
|
|
|
BOOL canShowDate = NO;
|
|
|
@ -5071,6 +5077,10 @@ typedef enum : NSUInteger {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (viewItem.interaction.timestampForSorting > collapseCutoffTimestamp) {
|
|
|
|
|
|
|
|
shouldHideFooter = NO;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
viewItem.isFirstInCluster = isFirstInCluster;
|
|
|
|
viewItem.isFirstInCluster = isFirstInCluster;
|
|
|
|
viewItem.isLastInCluster = isLastInCluster;
|
|
|
|
viewItem.isLastInCluster = isLastInCluster;
|
|
|
|
viewItem.shouldShowSenderAvatar = shouldShowSenderAvatar;
|
|
|
|
viewItem.shouldShowSenderAvatar = shouldShowSenderAvatar;
|
|
|
|