From c5d8a7cb380353e8cd7334d6148cd5a74d9ae8a2 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 5 Apr 2018 11:15:00 -0400 Subject: [PATCH] Clean up ahead of PR. --- .../Cells/OWSQuotedMessageView.m | 23 ++++++++++++------- .../translations/en.lproj/Localizable.strings | 3 +++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m index 2ad53ff37..11c35e60e 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSQuotedMessageView.m @@ -255,6 +255,11 @@ NS_ASSUME_NONNULL_BEGIN text = sourceFilename; textColor = self.filenameTextColor; font = self.filenameFont; + } else { + text = NSLocalizedString( + @"QUOTED_REPLY_TYPE_ATTACHMENT", @"Indicates this message is a quoted reply to an attachment of unknown type."); + textColor = self.fileTypeTextColor; + font = self.fileTypeFont; } UILabel *quotedTextLabel = [UILabel new]; @@ -271,14 +276,16 @@ NS_ASSUME_NONNULL_BEGIN { // TODO: Are we going to use the filename? For all mimetypes? NSString *_Nullable contentType = self.quotedMessage.contentType; - if (contentType.length > 0) { - if ([MIMETypeUtil isAudio:contentType]) { - return NSLocalizedString( - @"QUOTED_REPLY_TYPE_AUDIO", @"Indicates this message is a quoted reply to an audio file."); - } else if ([MIMETypeUtil isVideo:contentType]) { - return NSLocalizedString( - @"QUOTED_REPLY_TYPE_VIDEO", @"Indicates this message is a quoted reply to a video file."); - } + if (contentType.length < 1) { + return nil; + } + + if ([MIMETypeUtil isAudio:contentType]) { + return NSLocalizedString( + @"QUOTED_REPLY_TYPE_AUDIO", @"Indicates this message is a quoted reply to an audio file."); + } else if ([MIMETypeUtil isVideo:contentType]) { + return NSLocalizedString( + @"QUOTED_REPLY_TYPE_VIDEO", @"Indicates this message is a quoted reply to a video file."); } else if ([MIMETypeUtil isImage:contentType] || [MIMETypeUtil isAnimated:contentType]) { return NSLocalizedString( @"QUOTED_REPLY_TYPE_IMAGE", @"Indicates this message is a quoted reply to an image file."); diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 26a6e8f43..54c943161 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -1408,6 +1408,9 @@ /* Indicates the author of a quoted message. Embeds {{the author's name or phone number}}. */ "QUOTED_REPLY_AUTHOR_INDICATOR_FORMAT" = "Replying to %@"; +/* Indicates this message is a quoted reply to an attachment of unknown type. */ +"QUOTED_REPLY_TYPE_ATTACHMENT" = "Attachment"; + /* Indicates this message is a quoted reply to an audio file. */ "QUOTED_REPLY_TYPE_AUDIO" = "Audio";