“Add to contacts” offer.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-05-19 15:36:43 -04:00
parent bc63389d23
commit df2ee6ba55
2 changed files with 7 additions and 4 deletions

View File

@ -747,6 +747,10 @@ typedef enum : NSUInteger {
_composeOnOpen = keyboardOnViewAppearing;
_callOnOpen = callOnViewAppearing;
// We need to create the "unread indicator" before we mark
// all messages as read.
[self ensureThreadOffersAndIndicators];
[self markAllMessagesAsRead];
[self.uiDatabaseConnection beginLongLivedReadTransaction];
@ -2752,9 +2756,8 @@ typedef enum : NSUInteger {
OWSAssert([NSThread isMainThread]);
if (self.hasClearedUnreadMessagesIndicator) {
// ensureThreadOffersAndIndicators is slightly
// expensive, so make sure we don't call it
// unneccesarily.
// ensureThreadOffersAndIndicators is somewhat expensive
// so we don't want to call it unnecessarily.
return;
}

View File

@ -103,7 +103,7 @@ NS_ASSUME_NONNULL_BEGIN
__block TSUnreadIndicatorInteraction *unreadIndicator = nil;
__block TSIncomingMessage *firstIncomingMessage = nil;
__block TSOutgoingMessage *firstOutgoingMessage = nil;
__block TSMessage *firstUnreadMessage = nil;
__block TSIncomingMessage *firstUnreadMessage = nil;
__block long outgoingMessageCount = 0;
[[transaction ext:TSMessageDatabaseViewExtensionName]