|
|
|
@ -450,11 +450,11 @@ typedef enum : NSUInteger {
|
|
|
|
|
NSString *_Nullable recipientId = notification.userInfo[kNSNotificationKey_ProfileRecipientId];
|
|
|
|
|
NSData *_Nullable groupId = notification.userInfo[kNSNotificationKey_ProfileGroupId];
|
|
|
|
|
if (recipientId.length > 0 && [self.thread.recipientIdentifiers containsObject:recipientId]) {
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractions];
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractionsAndUpdateIfNecessary:YES];
|
|
|
|
|
} else if (groupId.length > 0 && self.thread.isGroupThread) {
|
|
|
|
|
TSGroupThread *groupThread = (TSGroupThread *)self.thread;
|
|
|
|
|
if ([groupThread.groupModel.groupId isEqualToData:groupId]) {
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractions];
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractionsAndUpdateIfNecessary:YES];
|
|
|
|
|
[self ensureBannerState];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -868,6 +868,7 @@ typedef enum : NSUInteger {
|
|
|
|
|
// Avoid layout corrupt issues and out-of-date message subtitles.
|
|
|
|
|
self.lastReloadDate = [NSDate new];
|
|
|
|
|
[self.conversationViewModel viewDidResetContentAndLayout];
|
|
|
|
|
[self tryToUpdateConversationSnapshot];
|
|
|
|
|
[self.collectionView.collectionViewLayout invalidateLayout];
|
|
|
|
|
[self.collectionView reloadData];
|
|
|
|
|
|
|
|
|
@ -2437,7 +2438,7 @@ typedef enum : NSUInteger {
|
|
|
|
|
|
|
|
|
|
- (void)contactsViewHelperDidUpdateContacts
|
|
|
|
|
{
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractions];
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractionsAndUpdateIfNecessary:YES];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)createConversationScrollButtons
|
|
|
|
@ -2475,7 +2476,7 @@ typedef enum : NSUInteger {
|
|
|
|
|
_hasUnreadMessages = hasUnreadMessages;
|
|
|
|
|
|
|
|
|
|
self.scrollDownButton.hasUnreadMessages = hasUnreadMessages;
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractions];
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractionsAndUpdateIfNecessary:YES];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)scrollDownButtonTapped
|
|
|
|
@ -2620,7 +2621,7 @@ typedef enum : NSUInteger {
|
|
|
|
|
[self showApprovalDialogForAttachment:attachment];
|
|
|
|
|
|
|
|
|
|
[ThreadUtil addThreadToProfileWhitelistIfEmptyContactThread:self.thread];
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractions];
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractionsAndUpdateIfNecessary:YES];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)messageWasSent:(TSOutgoingMessage *)message
|
|
|
|
@ -2980,7 +2981,7 @@ typedef enum : NSUInteger {
|
|
|
|
|
[self messageWasSent:message];
|
|
|
|
|
|
|
|
|
|
if (didAddToProfileWhitelist) {
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractions];
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractionsAndUpdateIfNecessary:YES];
|
|
|
|
|
}
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
@ -3626,7 +3627,7 @@ typedef enum : NSUInteger {
|
|
|
|
|
[self messageWasSent:message];
|
|
|
|
|
|
|
|
|
|
if (didAddToProfileWhitelist) {
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractions];
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractionsAndUpdateIfNecessary:YES];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -4029,7 +4030,7 @@ typedef enum : NSUInteger {
|
|
|
|
|
|
|
|
|
|
[self clearDraft];
|
|
|
|
|
if (didAddToProfileWhitelist) {
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractions];
|
|
|
|
|
[self.conversationViewModel ensureDynamicInteractionsAndUpdateIfNecessary:YES];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4927,6 +4928,15 @@ typedef enum : NSUInteger {
|
|
|
|
|
|
|
|
|
|
#pragma mark - Conversation Snapshot
|
|
|
|
|
|
|
|
|
|
- (void)tryToUpdateConversationSnapshot
|
|
|
|
|
{
|
|
|
|
|
if (!self.isObservingVMUpdates) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[self updateConversationSnapshot];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)updateConversationSnapshot
|
|
|
|
|
{
|
|
|
|
|
ConversationSnapshot *conversationSnapshot = [ConversationSnapshot new];
|
|
|
|
|