From 29c29c575260a9fba5dbb2290dcaea4bd818d799 Mon Sep 17 00:00:00 2001
From: Audric Ackermann <audric@loki.network>
Date: Thu, 24 Jun 2021 17:12:34 +1000
Subject: [PATCH] fix click to trust only dling file received

---
 _locales/en/messages.json                                 | 2 +-
 ts/components/conversation/message/ClickToTrustSender.tsx | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index 91b7dccb6..f11bd65ed 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -408,7 +408,7 @@
   "linkVisitWarningTitle": "Open this link in your browser?",
   "linkVisitWarningMessage": "Are you sure you want to open $url$ in your browser?",
   "open": "Open",
-  "clickToTrustContact": "Tap to download media",
+  "clickToTrustContact": "Click to download media",
   "trustThisContactDialogTitle": "Trust $name$?",
   "trustThisContactDialogDescription": "Are you sure you want to download media sent by $name$?"
 }
diff --git a/ts/components/conversation/message/ClickToTrustSender.tsx b/ts/components/conversation/message/ClickToTrustSender.tsx
index a495d8950..43eb71736 100644
--- a/ts/components/conversation/message/ClickToTrustSender.tsx
+++ b/ts/components/conversation/message/ClickToTrustSender.tsx
@@ -49,6 +49,9 @@ export const ClickToTrustSender = (props: { messageId: string }) => {
           await Promise.all(
             messagesInConvo.map(async message => {
               const msgAttachments = message.get('attachments');
+              if (message.get('direction') !== 'incoming') {
+                return;
+              }
               if (!msgAttachments || msgAttachments.length === 0) {
                 return;
               }