Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[qmf] Use EightBit for text and email files. Contributes to JB#12571
Previously attachments with text/* or message/rfc822 encoding were base64 encoded for no good reason. Change them to use EightBit transfer encoding. This fixes forwarding .eml files that previously were totally broken. Additionally it changes behaviour for text type files which no longer need to be base64 encoded using 25% less data.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
rpm/0019-Use-EightBit-encoding-instead-of-Base64-for-text-typ.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
From 6648e72b7db42dac51468c5225d89b2691019572 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Tomi=20Lepp=C3=A4nen?= <tomi.leppanen@jolla.com> | ||
Date: Mon, 30 Sep 2019 14:11:57 +0300 | ||
Subject: [PATCH] Use EightBit encoding instead of Base64 for text types | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
Previously attachments with text/* or message/rfc822 encoding were | ||
base64 encoded for no good reason. Change them to use EightBit transfer | ||
encoding. | ||
|
||
Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com> | ||
--- | ||
src/libraries/qmfclient/qmailmessage.cpp | 6 +++++- | ||
1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/src/libraries/qmfclient/qmailmessage.cpp b/src/libraries/qmfclient/qmailmessage.cpp | ||
index 71491f1a..d7678678 100644 | ||
--- a/src/libraries/qmfclient/qmailmessage.cpp | ||
+++ b/src/libraries/qmfclient/qmailmessage.cpp | ||
@@ -1579,7 +1579,11 @@ namespace attachments | ||
disposition.setParameter("filename*", QMailMessageContentDisposition::encodeParameter(input, "UTF-8")); | ||
} | ||
|
||
- container->appendPart(QMailMessagePart::fromFile(filePath, disposition,attach_type, QMailMessageBody::Base64, | ||
+ QMailMessageBody::TransferEncoding te(QMailMessageBody::Base64); | ||
+ if (attach_type.matches("text") || attach_type.matches("message", "rfc822")) | ||
+ te = QMailMessageBody::EightBit; | ||
+ | ||
+ container->appendPart(QMailMessagePart::fromFile(filePath, disposition, attach_type, te, | ||
QMailMessageBody::RequiresEncoding)); | ||
addedSome = true; | ||
} | ||
-- | ||
2.21.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters