diff --git a/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m b/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m index 8b2b148c5..f9ef89d83 100644 --- a/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m +++ b/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m @@ -1125,21 +1125,23 @@ NSString *NSStringForOutgoingMessageRecipientState(OWSOutgoingMessageRecipientSt } - (SSKProtoContentBuilder *)prepareCustomContentBuilder:(SignalRecipient *)recipient { - return SSKProtoContent.builder; -} - -- (nullable NSData *)buildPlainTextData:(SignalRecipient *)recipient -{ - NSError *error; SSKProtoDataMessage *_Nullable dataMessage = [self buildDataMessage:recipient.recipientId]; - if (error || !dataMessage) { - OWSFailDebug(@"could not build protobuf: %@", error); + if (!dataMessage) { + OWSFailDebug(@"could not build protobuf"); return nil; } + + SSKProtoContentBuilder *contentBuilder = SSKProtoContent.builder; + [contentBuilder setDataMessage:dataMessage]; + + return contentBuilder; +} +- (nullable NSData *)buildPlainTextData:(SignalRecipient *)recipient +{ SSKProtoContentBuilder *contentBuilder = [self prepareCustomContentBuilder:recipient]; + NSError *error; - [contentBuilder setDataMessage:dataMessage]; NSData *_Nullable contentData = [contentBuilder buildSerializedDataAndReturnError:&error]; if (error || !contentData) { OWSFailDebug(@"could not serialize protobuf: %@", error);