From 6ef65ad9d6178fd555cb61a269fc805b00eeb494 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 21 Feb 2019 11:48:58 -0500 Subject: [PATCH] Send and process 'recipient update' sync messages. --- SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m | 5 +++++ .../DeviceSyncing/OWSIncomingSentMessageTranscript.m | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m b/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m index 23433dda0..a619dd832 100644 --- a/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m +++ b/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m @@ -244,6 +244,11 @@ NS_ASSUME_NONNULL_BEGIN continue; } + if (!message.isFromLinkedDevice) { + OWSFailDebug(@"Ignoring 'recipient update' for message which was sent locally."); + continue; + } + OWSLogInfo(@"Processing 'recipient update' transcript in thread: %@, timestamp: %llu, nonUdRecipientIds: %d, " @"udRecipientIds: %d.", thread.uniqueId, diff --git a/SignalServiceKit/src/Messages/DeviceSyncing/OWSIncomingSentMessageTranscript.m b/SignalServiceKit/src/Messages/DeviceSyncing/OWSIncomingSentMessageTranscript.m index 06c350dc1..87ee6ddbb 100644 --- a/SignalServiceKit/src/Messages/DeviceSyncing/OWSIncomingSentMessageTranscript.m +++ b/SignalServiceKit/src/Messages/DeviceSyncing/OWSIncomingSentMessageTranscript.m @@ -41,7 +41,9 @@ NS_ASSUME_NONNULL_BEGIN if (self.isRecipientUpdate) { // Fetch, don't create. We don't want recipient updates to resurrect messages or threads. if (self.dataMessage.group) { - _thread = [TSGroupThread fetchObjectWithUniqueID:_dataMessage.group.id transaction:transaction]; + _thread = [TSGroupThread threadWithGroupId:_dataMessage.group.id transaction:transaction]; + } else { + OWSFailDebug(@"We should never receive a 'recipient update' for messages in contact threads."); } // Skip the other processing for recipient updates. } else {