diff --git a/Signal/src/Models/TSMessageAdapaters/OWSMessageMediaAdapter.h b/Signal/src/Models/TSMessageAdapaters/OWSMessageMediaAdapter.h index 72b06d71b..8c32a32b1 100644 --- a/Signal/src/Models/TSMessageAdapaters/OWSMessageMediaAdapter.h +++ b/Signal/src/Models/TSMessageAdapaters/OWSMessageMediaAdapter.h @@ -11,8 +11,8 @@ NS_ASSUME_NONNULL_BEGIN // Cells will request that this adapter clear its cached media views, // but the adapter should only honor requests from the last cell to // use its views. -- (void)setLastCell:(nullable id)cell; -- (void)clearCachedMediaViewsIfLastCell:(id)cell; +- (void)setLastPresentingCell:(nullable id)cell; +- (void)clearCachedMediaViewsIfLastPresentingCell:(id)cell; @end diff --git a/Signal/src/Models/TSMessageAdapaters/TSAnimatedAdapter.m b/Signal/src/Models/TSMessageAdapaters/TSAnimatedAdapter.m index 4d1a3dcb9..d1617ce51 100644 --- a/Signal/src/Models/TSMessageAdapaters/TSAnimatedAdapter.m +++ b/Signal/src/Models/TSMessageAdapaters/TSAnimatedAdapter.m @@ -21,7 +21,9 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) TSAttachmentStream *attachment; @property (nonatomic, nullable) AttachmentUploadView *attachmentUploadView; @property (nonatomic) BOOL incoming; -@property (nonatomic, nullable, weak) id lastCell; + +// See comments on OWSMessageMediaAdapter. +@property (nonatomic, nullable, weak) id lastPresentingCell; @end @@ -80,11 +82,11 @@ NS_ASSUME_NONNULL_BEGIN } } -- (void)clearCachedMediaViewsIfLastCell:(id)cell +- (void)clearCachedMediaViewsIfLastPresentingCell:(id)cell { OWSAssert(cell); - if (cell == self.lastCell) { + if (cell == self.lastPresentingCell) { [self clearCachedMediaViews]; } } diff --git a/Signal/src/Models/TSMessageAdapaters/TSGenericAttachmentAdapter.m b/Signal/src/Models/TSMessageAdapaters/TSGenericAttachmentAdapter.m index fccaa9d48..3186a1d02 100644 --- a/Signal/src/Models/TSMessageAdapaters/TSGenericAttachmentAdapter.m +++ b/Signal/src/Models/TSMessageAdapaters/TSGenericAttachmentAdapter.m @@ -21,7 +21,9 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) TSAttachmentStream *attachment; @property (nonatomic, nullable) AttachmentUploadView *attachmentUploadView; @property (nonatomic) BOOL incoming; -@property (nonatomic, nullable, weak) id lastCell; + +// See comments on OWSMessageMediaAdapter. +@property (nonatomic, nullable, weak) id lastPresentingCell; @end @@ -211,11 +213,11 @@ NS_ASSUME_NONNULL_BEGIN // Ignore. } -- (void)clearCachedMediaViewsIfLastCell:(id)cell +- (void)clearCachedMediaViewsIfLastPresentingCell:(id)cell { OWSAssert(cell); - if (cell == self.lastCell) { + if (cell == self.lastPresentingCell) { [self clearCachedMediaViews]; } } diff --git a/Signal/src/Models/TSMessageAdapaters/TSPhotoAdapter.m b/Signal/src/Models/TSMessageAdapaters/TSPhotoAdapter.m index 5adcb67d7..48d73ec7d 100644 --- a/Signal/src/Models/TSMessageAdapaters/TSPhotoAdapter.m +++ b/Signal/src/Models/TSMessageAdapaters/TSPhotoAdapter.m @@ -16,7 +16,9 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, nullable) UIImageView *cachedImageView; @property (nonatomic, nullable) AttachmentUploadView *attachmentUploadView; @property (nonatomic) BOOL incoming; -@property (nonatomic, nullable, weak) id lastCell; + +// See comments on OWSMessageMediaAdapter. +@property (nonatomic, nullable, weak) id lastPresentingCell; @end @@ -146,11 +148,11 @@ NS_ASSUME_NONNULL_BEGIN // Ignore. } -- (void)clearCachedMediaViewsIfLastCell:(id)cell +- (void)clearCachedMediaViewsIfLastPresentingCell:(id)cell { OWSAssert(cell); - if (cell == self.lastCell) { + if (cell == self.lastPresentingCell) { [self clearCachedMediaViews]; } } diff --git a/Signal/src/Models/TSMessageAdapaters/TSVideoAttachmentAdapter.m b/Signal/src/Models/TSMessageAdapaters/TSVideoAttachmentAdapter.m index 83ee2add5..2a97c4e5d 100644 --- a/Signal/src/Models/TSMessageAdapaters/TSVideoAttachmentAdapter.m +++ b/Signal/src/Models/TSMessageAdapaters/TSVideoAttachmentAdapter.m @@ -30,7 +30,9 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, nullable) AttachmentUploadView *attachmentUploadView; @property (nonatomic) BOOL isAudioPlaying; @property (nonatomic) BOOL isPaused; -@property (nonatomic, nullable, weak) id lastCell; + +// See comments on OWSMessageMediaAdapter. +@property (nonatomic, nullable, weak) id lastPresentingCell; @end @@ -295,11 +297,11 @@ NS_ASSUME_NONNULL_BEGIN // Ignore. } -- (void)clearCachedMediaViewsIfLastCell:(id)cell +- (void)clearCachedMediaViewsIfLastPresentingCell:(id)cell { OWSAssert(cell); - if (cell == self.lastCell) { + if (cell == self.lastPresentingCell) { [self clearCachedMediaViews]; } } diff --git a/Signal/src/views/OWSIncomingMessageCollectionViewCell.m b/Signal/src/views/OWSIncomingMessageCollectionViewCell.m index 49ada508b..6d3378980 100644 --- a/Signal/src/views/OWSIncomingMessageCollectionViewCell.m +++ b/Signal/src/views/OWSIncomingMessageCollectionViewCell.m @@ -32,8 +32,8 @@ NS_ASSUME_NONNULL_BEGIN [self.mediaAdapter setCellVisible:NO]; // Clear this adapter's views IFF this was the last cell to use this adapter. - [self.mediaAdapter clearCachedMediaViewsIfLastCell:self]; - [_mediaAdapter setLastCell:nil]; + [self.mediaAdapter clearCachedMediaViewsIfLastPresentingCell:self]; + [_mediaAdapter setLastPresentingCell:nil]; self.mediaAdapter = nil; } @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN _mediaAdapter = mediaAdapter; // Mark this as the last cell to use this adapter. - [_mediaAdapter setLastCell:self]; + [_mediaAdapter setLastPresentingCell:self]; } // pragma mark - OWSMessageCollectionViewCell diff --git a/Signal/src/views/OWSOutgoingMessageCollectionViewCell.m b/Signal/src/views/OWSOutgoingMessageCollectionViewCell.m index 8362a9fc5..186fbabc3 100644 --- a/Signal/src/views/OWSOutgoingMessageCollectionViewCell.m +++ b/Signal/src/views/OWSOutgoingMessageCollectionViewCell.m @@ -33,8 +33,8 @@ NS_ASSUME_NONNULL_BEGIN [self.mediaAdapter setCellVisible:NO]; // Clear this adapter's views IFF this was the last cell to use this adapter. - [self.mediaAdapter clearCachedMediaViewsIfLastCell:self]; - [_mediaAdapter setLastCell:nil]; + [self.mediaAdapter clearCachedMediaViewsIfLastPresentingCell:self]; + [_mediaAdapter setLastPresentingCell:nil]; self.mediaAdapter = nil; } @@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN _mediaAdapter = mediaAdapter; // Mark this as the last cell to use this adapter. - [_mediaAdapter setLastCell:self]; + [_mediaAdapter setLastPresentingCell:self]; } // pragma mark - OWSMessageCollectionViewCell