Respond to CR.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 4d57402367
commit 8b6265f1b5

@ -34,7 +34,7 @@ NSUInteger const TSAttachmentSchemaVersion = 4;
if (contentType.length < 1) { if (contentType.length < 1) {
DDLogWarn(@"%@ incoming attachment has invalid content type", self.tag); DDLogWarn(@"%@ incoming attachment has invalid content type", self.tag);
contentType = @"application/octet-stream"; contentType = OWSMimeTypeApplicationOctetStream;
} }
OWSAssert(contentType.length > 0); OWSAssert(contentType.length > 0);
@ -63,7 +63,7 @@ NSUInteger const TSAttachmentSchemaVersion = 4;
if (contentType.length < 1) { if (contentType.length < 1) {
DDLogWarn(@"%@ outgoing attachment has invalid content type", self.tag); DDLogWarn(@"%@ outgoing attachment has invalid content type", self.tag);
contentType = @"application/octet-stream"; contentType = OWSMimeTypeApplicationOctetStream;
} }
OWSAssert(contentType.length > 0); OWSAssert(contentType.length > 0);
OWSAssert(byteCount > 0); OWSAssert(byteCount > 0);
@ -108,7 +108,7 @@ NSUInteger const TSAttachmentSchemaVersion = 4;
if (contentType.length < 1) { if (contentType.length < 1) {
DDLogWarn(@"%@ incoming attachment has invalid content type", self.tag); DDLogWarn(@"%@ incoming attachment has invalid content type", self.tag);
contentType = @"application/octet-stream"; contentType = OWSMimeTypeApplicationOctetStream;
} }
_contentType = contentType; _contentType = contentType;
@ -138,7 +138,7 @@ NSUInteger const TSAttachmentSchemaVersion = 4;
if (_contentType.length < 1) { if (_contentType.length < 1) {
DDLogWarn(@"%@ legacy attachment has invalid content type", self.tag); DDLogWarn(@"%@ legacy attachment has invalid content type", self.tag);
_contentType = @"application/octet-stream"; _contentType = OWSMimeTypeApplicationOctetStream;
} }
return self; return self;

@ -541,7 +541,6 @@ NSString *const kTSOutgoingMessageSentRecipientAll = @"kTSOutgoingMessageSentRec
OWSSignalServiceProtosAttachmentPointerBuilder *builder = [OWSSignalServiceProtosAttachmentPointerBuilder new]; OWSSignalServiceProtosAttachmentPointerBuilder *builder = [OWSSignalServiceProtosAttachmentPointerBuilder new];
[builder setId:attachmentStream.serverId]; [builder setId:attachmentStream.serverId];
NSString *contentType = attachmentStream.contentType;
OWSAssert(attachmentStream.contentType.length > 0); OWSAssert(attachmentStream.contentType.length > 0);
[builder setContentType:attachmentStream.contentType]; [builder setContentType:attachmentStream.contentType];
[builder setFileName:filename]; [builder setFileName:filename];

Loading…
Cancel
Save