From aa5b0ed6e4f8d1b7bd1f81e3620a5d8d47a6cbf7 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 8 Apr 2021 15:08:34 +1000 Subject: [PATCH] Don't show placeholder for sent media --- Session/Conversations/ConversationVC+Interaction.swift | 3 ++- Session/Conversations/Message Cells/VisibleMessageCell.swift | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index a90e1e690..3beaac5a6 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -382,7 +382,8 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc case .mediaMessage: guard let index = viewItems.firstIndex(where: { $0 === viewItem }), let cell = messagesTableView.cellForRow(at: IndexPath(row: index, section: 0)) as? VisibleMessageCell else { return } - if let thread = self.thread as? TSContactThread, + if viewItem.interaction is TSIncomingMessage, + let thread = self.thread as? TSContactThread, Storage.shared.getContact(with: thread.contactIdentifier())?.isTrusted != true { // Ask the user whether they want to download this attachment let modal = DownloadAttachmentModal(viewItem: viewItem) diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index 62f9788a9..aefe2ccb3 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -337,7 +337,8 @@ final class VisibleMessageCell : MessageCell, LinkPreviewViewDelegate { stackView.pin(to: snContentView, withInset: inset) } case .mediaMessage: - if let thread = viewItem.interaction.thread as? TSContactThread, + if viewItem.interaction is TSIncomingMessage, + let thread = viewItem.interaction.thread as? TSContactThread, Storage.shared.getContact(with: thread.contactIdentifier())?.isTrusted != true { let mediaPlaceholderView = MediaPlaceholderView(viewItem: viewItem, textColor: bodyLabelTextColor) snContentView.addSubview(mediaPlaceholderView)