From 6cc28bdf8fb5a792fd2b7d106afdedf68f6ff628 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 15 Mar 2019 16:25:59 -0400 Subject: [PATCH] Redraw message bubbles when corner state changes. --- .../ConversationView/ConversationViewItem.m | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m index 5999f6731..9f2f6a2a0 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m @@ -283,6 +283,32 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType) [self clearCachedLayoutState]; } +- (void)setIsFirstInCluster:(BOOL)isFirstInCluster +{ + if (_isFirstInCluster == isFirstInCluster) { + return; + } + + _isFirstInCluster = isFirstInCluster; + + // Although this doesn't affect layout size, the view model use + // hasCachedLayoutState to detect which cells needs to be redrawn due to changes. + [self clearCachedLayoutState]; +} + +- (void)setIsLastInCluster:(BOOL)isLastInCluster +{ + if (_isLastInCluster == isLastInCluster) { + return; + } + + _isLastInCluster = isLastInCluster; + + // Although this doesn't affect layout size, the view model use + // hasCachedLayoutState to detect which cells needs to be redrawn due to changes. + [self clearCachedLayoutState]; +} + - (void)setUnreadIndicator:(nullable OWSUnreadIndicator *)unreadIndicator { if ([NSObject isNullableObject:_unreadIndicator equalTo:unreadIndicator]) {