Set the timestamp property on data messages.

This commit is contained in:
Matthew Chen 2018-01-31 14:30:34 -05:00
parent 4218af13d5
commit 59ff1561f5
5 changed files with 10 additions and 4 deletions

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSSyncGroupsRequestMessage.h"
@ -55,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
[groupContextBuilder setId:self.groupId];
OWSSignalServiceProtosDataMessageBuilder *builder = [OWSSignalServiceProtosDataMessageBuilder new];
[builder setTimestamp:self.timestamp];
[builder setGroupBuilder:groupContextBuilder];
return builder;

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSDisappearingMessagesConfigurationMessage.h"
@ -38,6 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
- (OWSSignalServiceProtosDataMessageBuilder *)dataMessageBuilder
{
OWSSignalServiceProtosDataMessageBuilder *dataMessageBuilder = [super dataMessageBuilder];
[dataMessageBuilder setTimestamp:self.timestamp];
[dataMessageBuilder setFlags:OWSSignalServiceProtosDataMessageFlagsExpirationTimerUpdate];
if (self.configuration.isEnabled) {
[dataMessageBuilder setExpireTimer:self.configuration.durationSeconds];

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSEndSessionMessage.h"
@ -17,6 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
- (OWSSignalServiceProtosDataMessageBuilder *)dataMessageBuilder
{
OWSSignalServiceProtosDataMessageBuilder *builder = [super dataMessageBuilder];
[builder setTimestamp:self.timestamp];
[builder setFlags:OWSSignalServiceProtosDataMessageFlagsEndSession];
return builder;

View file

@ -446,6 +446,7 @@ NSString *const kTSOutgoingMessageSentRecipientAll = @"kTSOutgoingMessageSentRec
{
TSThread *thread = self.thread;
OWSSignalServiceProtosDataMessageBuilder *builder = [OWSSignalServiceProtosDataMessageBuilder new];
[builder setTimestamp:self.timestamp];
[builder setBody:self.body];
BOOL attachmentWasGroupAvatar = NO;
if ([thread isKindOfClass:[TSGroupThread class]]) {
@ -495,6 +496,7 @@ NSString *const kTSOutgoingMessageSentRecipientAll = @"kTSOutgoingMessageSentRec
OWSAssert(self.thread);
OWSSignalServiceProtosDataMessageBuilder *builder = [self dataMessageBuilder];
[builder setTimestamp:self.timestamp];
[builder addLocalProfileKeyIfNecessary:self.thread recipientId:recipientId];
return [builder build];
}

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSProfileKeyMessage.h"
@ -27,6 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert(self.thread);
OWSSignalServiceProtosDataMessageBuilder *builder = [self dataMessageBuilder];
[builder setTimestamp:self.timestamp];
[builder addLocalProfileKey];
[builder setFlags:OWSSignalServiceProtosDataMessageFlagsProfileKeyUpdate];