From 08ba3852cdb3dca53fcdbb1cffde11b7bf4482be Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 4 Apr 2018 15:55:19 -0400 Subject: [PATCH] Refine appearance of quoted reply message cells. --- .../Cells/OWSQuotedMessageView.m | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m index 0fa2932a7..349bde007 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m @@ -75,15 +75,32 @@ NS_ASSUME_NONNULL_BEGIN - (BOOL)hasQuotedAttachment { - return self.quotedMessage.contentType.length > 0; + return (self.quotedMessage.contentType.length > 0 + && ![NSObject isNullableObject:self.quotedMessage.contentType equalTo:OWSMimeTypeOversizeTextMessage]); } - (BOOL)hasQuotedAttachmentThumbnail { - return (self.quotedMessage.contentType.length > 0 && + return (self.quotedMessage.contentType.length > 0 + && ![NSObject isNullableObject:self.quotedMessage.contentType equalTo:OWSMimeTypeOversizeTextMessage] && [TSAttachmentStream hasThumbnailForMimeType:self.quotedMessage.contentType]); } +- (NSString *)quotedSnippet +{ + if (self.displayableQuotedText.displayText.length > 0) { + return self.displayableQuotedText.displayText; + } else { + NSString *mimeType = self.quotedMessage.contentType; + + if (mimeType.length > 0) { + return [TSAttachment emojiForMimeType:mimeType]; + } + } + + return @""; +} + #pragma mark - - (void)createContents @@ -282,21 +299,6 @@ NS_ASSUME_NONNULL_BEGIN return [UIColor blackColor]; } -- (NSString *)quotedSnippet -{ - if (self.displayableQuotedText.displayText.length > 0) { - return self.displayableQuotedText.displayText; - } else { - NSString *mimeType = self.quotedMessage.contentType; - - if (mimeType.length > 0) { - return [TSAttachment emojiForMimeType:mimeType]; - } - } - - return @""; -} - // TODO: - (UIFont *)quotedAuthorFont {