From 4d0362f9a60b5f95fc16abd57d48f0bb6a19c8eb Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 13 Feb 2018 18:02:59 -0800 Subject: [PATCH] Don't create redundant caption for sync'd transcripts. Note: For test devices running HEAD, there may have already been some redundant captions created for sync'd transcripts. However the existing `TSMessage#initWithCoder:` migration will address this for our production users, so I'm not going to bother with a second migration just for our test devices. // FREEBIE --- .../src/Devices/OWSRecordTranscriptJob.m | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m b/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m index c50b404f8..9e5191e00 100644 --- a/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m +++ b/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m @@ -125,21 +125,6 @@ NS_ASSUME_NONNULL_BEGIN self.logTag, outgoingMessage); }]; - - // If there is an attachment + text, render the text here, as Signal-iOS renders two messages. - if (attachmentsProcessor.hasSupportedAttachments && transcript.body && ![transcript.body isEqualToString:@""]) { - // We want the text to appear after the attachment. - uint64_t textMessageTimestamp = transcript.timestamp + 1; - TSOutgoingMessage *textMessage = [[TSOutgoingMessage alloc] initWithTimestamp:textMessageTimestamp - inThread:thread - messageBody:transcript.body - attachmentIds:[NSMutableArray new] - expiresInSeconds:transcript.expirationDuration - expireStartedAt:transcript.expirationStartedAt]; - // Since textMessage is a new message, updateWithWasSentAndDelivered will save it. - [textMessage saveWithTransaction:transaction]; - [textMessage updateWithWasSentFromLinkedDeviceWithTransaction:transaction]; - } } @end