Fix self sync messages.

Timestamps were not matching and thus messages were always showing `Bad encrypted message`. Signal upstream had fixed this already so i just got the upstream code and modified it to fit our current code.
pull/67/head
Mikunj 5 years ago
parent 5d4c8b7e94
commit c5d1047166

@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithOutgoingMessage:(TSOutgoingMessage *)message isRecipientUpdate:(BOOL)isRecipientUpdate
{
self = [super init];
self = [super initWithTimestamp:message.timestamp];
if (!self) {
return self;

@ -25,6 +25,8 @@ NS_ASSUME_NONNULL_BEGIN
contactShare:(nullable OWSContact *)contactShare
linkPreview:(nullable OWSLinkPreview *)linkPreview NS_UNAVAILABLE;
- (instancetype)initWithTimestamp:(uint64_t)timestamp;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;

@ -39,6 +39,27 @@ NS_ASSUME_NONNULL_BEGIN
return self;
}
- (instancetype)initWithTimestamp:(uint64_t)timestamp
{
self = [super initOutgoingMessageWithTimestamp:timestamp
inThread:nil
messageBody:nil
attachmentIds:[NSMutableArray new]
expiresInSeconds:0
expireStartedAt:0
isVoiceMessage:NO
groupMetaMessage:TSGroupMetaMessageUnspecified
quotedMessage:nil
contactShare:nil
linkPreview:nil];
if (!self) {
return self;
}
return self;
}
- (BOOL)shouldBeSaved
{
return NO;

Loading…
Cancel
Save