Timer info messages *before* the message which changed the timer

// FREEBIE
This commit is contained in:
Michael Kirk 2018-04-18 11:45:55 -04:00
parent a9e7c5e879
commit eb140a6839
2 changed files with 12 additions and 4 deletions

View file

@ -49,6 +49,13 @@ NS_ASSUME_NONNULL_BEGIN
return self; return self;
} }
- (BOOL)shouldUseReceiptDateForSorting
{
// Use the timestamp, not the "received at" timestamp to sort,
// since we're creating these interactions after the fact and back-dating them.
return NO;
}
- (NSString *)description - (NSString *)description
{ {
if (self.createdByRemoteName) { if (self.createdByRemoteName) {

View file

@ -254,16 +254,17 @@ void AssertIsOnDisappearingMessagesQueue()
NSString *contactName = [contactsManager displayNameForPhoneIdentifier:incomingMessage.messageAuthorId]; NSString *contactName = [contactsManager displayNameForPhoneIdentifier:incomingMessage.messageAuthorId];
// We want the info message to appear _before_ the message. // We want the info message to appear _before_ the message.
[[[OWSDisappearingConfigurationUpdateInfoMessage alloc] initWithTimestamp:message.timestamp - 1 [[[OWSDisappearingConfigurationUpdateInfoMessage alloc] initWithTimestamp:message.timestampForSorting - 1
thread:message.thread thread:message.thread
configuration:disappearingMessagesConfiguration configuration:disappearingMessagesConfiguration
createdByRemoteName:contactName] saveWithTransaction:transaction]; createdByRemoteName:contactName]
saveWithTransaction:transaction];
} else { } else {
// We want the info message to appear _before_ the message. // We want the info message to appear _before_ the message.
[[[OWSDisappearingConfigurationUpdateInfoMessage alloc] initWithTimestamp:message.timestamp - 1 [[[OWSDisappearingConfigurationUpdateInfoMessage alloc] initWithTimestamp:message.timestampForSorting - 1
thread:message.thread thread:message.thread
configuration:disappearingMessagesConfiguration] configuration:disappearingMessagesConfiguration]
saveWithTransaction:transaction]; saveWithTransaction:transaction];
} }
backgroundTask = nil; backgroundTask = nil;