From 27e02591571231e983b2cdad8fa520979ad68ab2 Mon Sep 17 00:00:00 2001 From: saturneric Date: Sun, 1 Dec 2024 19:07:39 +0100 Subject: [PATCH] fix: public key export on windows is using CRLF --- src/m_email/EMailBasicGpgOpera.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/m_email/EMailBasicGpgOpera.cpp b/src/m_email/EMailBasicGpgOpera.cpp index c584d30..2b3b503 100644 --- a/src/m_email/EMailBasicGpgOpera.cpp +++ b/src/m_email/EMailBasicGpgOpera.cpp @@ -532,11 +532,14 @@ auto SignPlainText(int channel, const QString& key, return -1; } + public_key.replace("\r\n", "\n"); + public_key.replace("\n", "\r\n"); + auto public_key_part_part_body = public_key_part->getBody(); auto public_key_part_body_content = vmime::make_shared(); public_key_part_body_content->setData( - public_key.toLatin1().replace('\n', "\r\n").toStdString(), + public_key.toLatin1().toStdString(), vmime::encoding(vmime::encodingTypes::QUOTED_PRINTABLE)); public_key_part_part_body->setContents(public_key_part_body_content); @@ -750,11 +753,14 @@ auto SignEMLData(int channel, const QString& key, return -1; } + public_key.replace("\r\n", "\n"); + public_key.replace("\n", "\r\n"); + auto public_key_part_part_body = public_key_part->getBody(); auto public_key_part_body_content = vmime::make_shared(); public_key_part_body_content->setData( - public_key.toLatin1().replace('\n', "\r\n").toStdString(), + public_key.toLatin1().toStdString(), vmime::encoding(vmime::encodingTypes::QUOTED_PRINTABLE)); public_key_part_part_body->setContents(public_key_part_body_content);