diff --git a/Session/Conversations/ConversationViewModel.m b/Session/Conversations/ConversationViewModel.m index 588711011..1e5293b73 100644 --- a/Session/Conversations/ConversationViewModel.m +++ b/Session/Conversations/ConversationViewModel.m @@ -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 _Nullable nextItemId = (oldIndex + 1 < oldItemIdList.count ? oldItemIdList[oldIndex + 1] : nil); + if (nextItemId != nil) { + [updatedItemSet addObject:nextItemId]; + [updatedNeighborItemSet addObject:nextItemId]; + } + } } // 3. Updates.