From 116f0536136589b638dcf9ab171d7e2ced396a72 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 7 Sep 2017 04:16:03 +0200 Subject: Fixed RE: prefixing on replies --- framework/src/domain/mime/mailtemplates.cpp | 3 ++- framework/src/domain/mime/tests/mailtemplatetest.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'framework/src') diff --git a/framework/src/domain/mime/mailtemplates.cpp b/framework/src/domain/mime/mailtemplates.cpp index f672692b..dc4f93b5 100644 --- a/framework/src/domain/mime/mailtemplates.cpp +++ b/framework/src/domain/mime/mailtemplates.cpp @@ -102,7 +102,8 @@ QString replacePrefixes(const QString &str, const QStringList &prefixRegExps, co if (rx.indexIn(tmp) == 0) { return tmp.replace(0, rx.matchedLength(), newPrefix + QLatin1String(" ")); } - return str; + //No match, we just prefix the newPrefix + return newPrefix + " " + str; } const QStringList getForwardPrefixes() diff --git a/framework/src/domain/mime/tests/mailtemplatetest.cpp b/framework/src/domain/mime/tests/mailtemplatetest.cpp index 1fff4c78..700ae7a3 100644 --- a/framework/src/domain/mime/tests/mailtemplatetest.cpp +++ b/framework/src/domain/mime/tests/mailtemplatetest.cpp @@ -113,6 +113,7 @@ private slots: QTRY_VERIFY(result); QCOMPARE(normalize(removeFirstLine(result->body())), normalize(msg->body())); QCOMPARE(result->to()->addresses(), {{"konqi@example.org"}}); + QCOMPARE(result->subject()->asUnicodeString(), {"RE: A random subject with alternative contenttype"}); } void testHtmlReply() -- cgit v1.2.3