diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m index 61db6eecc..ff7e0cf5c 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageCell.m @@ -1134,19 +1134,6 @@ NS_ASSUME_NONNULL_BEGIN } } -// case TSInfoMessageAdapter: { -// // HACK this will get called when we get a new info message, but there's gotta be a better spot for this. -// OWSDisappearingMessagesConfiguration *configuration = -// [OWSDisappearingMessagesConfiguration fetchObjectWithUniqueID:self.thread.uniqueId]; -// [self setBarButtonItemsForDisappearingMessagesConfiguration:configuration]; -// -// if (message.shouldStartExpireTimer && [cell conformsToProtocol:@protocol(OWSExpirableMessageView)]) { -// id expirableView = (id)cell; -// [expirableView startExpirationTimerWithExpiresAtSeconds:message.expiresAtSeconds -// initialDurationSeconds:message.expiresInSeconds]; -// } -// - #pragma mark - Gesture recognizers - (void)handleTapGesture:(UITapGestureRecognizer *)sender diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 5a97d4ba8..55b86352c 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -586,10 +586,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { // unless it ever becomes possible to load this VC without going via the HomeViewController. [self.contactsManager requestSystemContactsOnce]; - [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *_Nonnull transaction) { - self.disappearingMessagesConfiguration = - [OWSDisappearingMessagesConfiguration fetchObjectWithUniqueID:self.thread.uniqueId transaction:transaction]; - }]; + [self updateDisappearingMessagesConfiguration]; [self updateBarButtonItems]; [self setNavigationTitle]; @@ -1528,6 +1525,14 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { } } +- (void)updateDisappearingMessagesConfiguration +{ + [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *_Nonnull transaction) { + self.disappearingMessagesConfiguration = + [OWSDisappearingMessagesConfiguration fetchObjectWithUniqueID:self.thread.uniqueId transaction:transaction]; + }]; +} + - (void)setDisappearingMessagesConfiguration: (nullable OWSDisappearingMessagesConfiguration *)disappearingMessagesConfiguration { @@ -2818,10 +2823,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { [self setNavigationTitle]; } - [self.uiDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *_Nonnull transaction) { - self.disappearingMessagesConfiguration = - [OWSDisappearingMessagesConfiguration fetchObjectWithUniqueID:self.thread.uniqueId transaction:transaction]; - }]; + [self updateDisappearingMessagesConfiguration]; if (![[self.uiDatabaseConnection ext:TSMessageDatabaseViewExtensionName] hasChangesForGroup:self.thread.uniqueId inNotifications:notifications]) {