fix the date header issue

This commit is contained in:
ryanzhao 2021-08-09 11:14:51 +10:00
parent 7fe0e46445
commit ce8f4f984d
1 changed files with 11 additions and 0 deletions

View File

@ -830,6 +830,17 @@ NS_ASSUME_NONNULL_BEGIN
[updatedNeighborItemSet addObject:itemId];
}
}
// Add the following item of a deleted message to update
// to show the date header of the deleted message if needed
for (NSString *deletedItemId in deletedItemIdSet) {
NSUInteger oldIndex = [oldItemIdList indexOfObject:deletedItemId];
id<ConversationViewItem> _Nullable nextItemId = (oldIndex + 1 < oldItemIdList.count ? oldItemIdList[oldIndex + 1] : nil);
if (nextItemId != nil) {
[updatedItemSet addObject:nextItemId];
[updatedNeighborItemSet addObject:nextItemId];
}
}
}
// 3. Updates.