Skip expiration for calls.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 7052b97c72
commit 26836a5725

@ -120,17 +120,21 @@ NSString *const OWSReadReceiptsProcessorMarkedMessageAsReadNotification =
// * Don't update expiration; we'll do that in the next statement.
[interaction markAsReadWithTransaction:transaction sendReadReceipt:NO updateExpiration:NO];
if ([interaction isKindOfClass:[TSMessage class]]) {
TSMessage *otherMessage = (TSMessage *)interaction;
// Update expiration using the timestamp from the readReceipt.
[OWSDisappearingMessagesJob setExpirationForMessage:(TSMessage *)interaction
[OWSDisappearingMessagesJob setExpirationForMessage:otherMessage
expirationStartedAt:readReceipt.timestamp];
// Fire event that will cancel any pending notifications for this message.
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter]
postNotificationName:OWSReadReceiptsProcessorMarkedMessageAsReadNotification
object:(TSMessage *)interaction];
object:otherMessage];
});
}
}
}];
// If it was previously saved, no need to keep it around any longer.

Loading…
Cancel
Save