|
|
|
@ -3215,7 +3215,6 @@ typedef enum : NSUInteger {
|
|
|
|
|
|
|
|
|
|
// We need to reload any modified interactions _before_ we call
|
|
|
|
|
// reloadViewItems.
|
|
|
|
|
BOOL hasDeletions = NO;
|
|
|
|
|
BOOL hasMalformedRowChange = NO;
|
|
|
|
|
for (YapDatabaseViewRowChange *rowChange in rowChanges) {
|
|
|
|
|
switch (rowChange.type) {
|
|
|
|
@ -3245,7 +3244,6 @@ typedef enum : NSUInteger {
|
|
|
|
|
} else {
|
|
|
|
|
hasMalformedRowChange = YES;
|
|
|
|
|
}
|
|
|
|
|
hasDeletions = YES;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
@ -3264,7 +3262,6 @@ typedef enum : NSUInteger {
|
|
|
|
|
[self.collectionView reloadData];
|
|
|
|
|
self.lastReloadDate = [NSDate new];
|
|
|
|
|
[self updateLastVisibleTimestamp];
|
|
|
|
|
[self cleanUpUnreadIndicatorIfNecessary];
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3349,9 +3346,6 @@ typedef enum : NSUInteger {
|
|
|
|
|
if (scrollToBottom) {
|
|
|
|
|
[self scrollToBottomAnimated:shouldAnimateScrollToBottom && shouldAnimateUpdates];
|
|
|
|
|
}
|
|
|
|
|
if (hasDeletions) {
|
|
|
|
|
[self cleanUpUnreadIndicatorIfNecessary];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
if (shouldAnimateUpdates) {
|
|
|
|
|
[self.collectionView performBatchUpdates:batchUpdates completion:batchUpdatesCompletion];
|
|
|
|
@ -3785,17 +3779,6 @@ typedef enum : NSUInteger {
|
|
|
|
|
self.hasUnreadMessages = numberOfUnreadMessages > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)cleanUpUnreadIndicatorIfNecessary
|
|
|
|
|
{
|
|
|
|
|
BOOL hasUnreadIndicator = self.dynamicInteractions.unreadIndicator != nil;
|
|
|
|
|
if (!hasUnreadIndicator) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// If the last unread message was deleted (manually or due to disappearing messages)
|
|
|
|
|
// we may need to clean up an obsolete unread indicator.
|
|
|
|
|
[self ensureDynamicInteractions];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)updateLastVisibleTimestamp:(uint64_t)timestamp
|
|
|
|
|
{
|
|
|
|
|
OWSAssert(timestamp > 0);
|
|
|
|
@ -4924,6 +4907,11 @@ typedef enum : NSUInteger {
|
|
|
|
|
viewItem.shouldHideFooter = shouldHideFooter;
|
|
|
|
|
viewItem.senderName = senderName;
|
|
|
|
|
}
|
|
|
|
|
if (unreadIndicator) {
|
|
|
|
|
// This isn't necessarily a bug - all of the interactions after the
|
|
|
|
|
// unread indicator may have disappeared or been deleted.
|
|
|
|
|
DDLogWarn(@"%@ Couldn't find an interaction to hang the unread indicator on.", self.logTag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
self.viewItems = viewItems;
|
|
|
|
|
self.viewItemCache = viewItemCache;
|
|
|
|
|