From c15459f0a92d69c85318f11779a5537eb24e30b6 Mon Sep 17 00:00:00 2001 From: Personal Date: Tue, 5 Oct 2021 21:20:19 +0300 Subject: [PATCH] Adding .pgp extension to attachments right before sending them --- .../Compose Message Service/ComposeMessageAttachment.swift | 6 +++--- .../Compose Message Service/ComposeMessageService.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageAttachment.swift b/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageAttachment.swift index 6f8e7074d..5e0e5f0e4 100644 --- a/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageAttachment.swift +++ b/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageAttachment.swift @@ -35,7 +35,7 @@ extension ComposeMessageAttachment { guard let url = librarySourceMediaInfo[urlKey] as? URL else { return nil } let data = try Data(contentsOf: url) - self.name = "\(url.lastPathComponent).pgp" + self.name = url.lastPathComponent self.data = data self.size = data.count self.type = url.lastPathComponent.mimeType @@ -50,7 +50,7 @@ extension ComposeMessageAttachment { return nil } - self.name = "\(UUID().uuidString).jpg.pgp" + self.name = "\(UUID().uuidString).jpg" self.data = data self.size = data.count self.type = "image/jpg" @@ -61,7 +61,7 @@ extension ComposeMessageAttachment { return nil } - self.name = "\(fileURL.lastPathComponent).pgp" + self.name = fileURL.lastPathComponent self.data = data self.size = data.count self.type = fileURL.mimeType diff --git a/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift b/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift index e0bc56092..8b6728e83 100644 --- a/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift +++ b/FlowCrypt/Functionality/Services/Compose Message Service/ComposeMessageService.swift @@ -85,7 +85,7 @@ final class ComposeMessageService { let sendableAttachments: [SendableMsg.Attachment] = contextToSend.attachments .map { composeAttachment in return SendableMsg.Attachment( - name: composeAttachment.name, + name: "\(composeAttachment.name).pgp", type: composeAttachment.type, base64: composeAttachment.data.base64EncodedString() )