From 8b6265f1b56c9397efade9f6f5e48cd10e2c3be6 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 3 Nov 2017 15:24:22 -0400 Subject: [PATCH] Respond to CR. // FREEBIE --- SignalServiceKit/src/Messages/Attachments/TSAttachment.m | 8 ++++---- .../src/Messages/Interactions/TSOutgoingMessage.m | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/SignalServiceKit/src/Messages/Attachments/TSAttachment.m b/SignalServiceKit/src/Messages/Attachments/TSAttachment.m index 5fb730562..c2d5c1565 100644 --- a/SignalServiceKit/src/Messages/Attachments/TSAttachment.m +++ b/SignalServiceKit/src/Messages/Attachments/TSAttachment.m @@ -34,7 +34,7 @@ NSUInteger const TSAttachmentSchemaVersion = 4; if (contentType.length < 1) { DDLogWarn(@"%@ incoming attachment has invalid content type", self.tag); - contentType = @"application/octet-stream"; + contentType = OWSMimeTypeApplicationOctetStream; } OWSAssert(contentType.length > 0); @@ -63,7 +63,7 @@ NSUInteger const TSAttachmentSchemaVersion = 4; if (contentType.length < 1) { DDLogWarn(@"%@ outgoing attachment has invalid content type", self.tag); - contentType = @"application/octet-stream"; + contentType = OWSMimeTypeApplicationOctetStream; } OWSAssert(contentType.length > 0); OWSAssert(byteCount > 0); @@ -108,7 +108,7 @@ NSUInteger const TSAttachmentSchemaVersion = 4; if (contentType.length < 1) { DDLogWarn(@"%@ incoming attachment has invalid content type", self.tag); - contentType = @"application/octet-stream"; + contentType = OWSMimeTypeApplicationOctetStream; } _contentType = contentType; @@ -138,7 +138,7 @@ NSUInteger const TSAttachmentSchemaVersion = 4; if (_contentType.length < 1) { DDLogWarn(@"%@ legacy attachment has invalid content type", self.tag); - _contentType = @"application/octet-stream"; + _contentType = OWSMimeTypeApplicationOctetStream; } return self; diff --git a/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m b/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m index 0c6d81ee4..2bc575a28 100644 --- a/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m +++ b/SignalServiceKit/src/Messages/Interactions/TSOutgoingMessage.m @@ -541,7 +541,6 @@ NSString *const kTSOutgoingMessageSentRecipientAll = @"kTSOutgoingMessageSentRec OWSSignalServiceProtosAttachmentPointerBuilder *builder = [OWSSignalServiceProtosAttachmentPointerBuilder new]; [builder setId:attachmentStream.serverId]; - NSString *contentType = attachmentStream.contentType; OWSAssert(attachmentStream.contentType.length > 0); [builder setContentType:attachmentStream.contentType]; [builder setFileName:filename];