diff --git a/messagecore/src/messagecoreutil.cpp b/messagecore/src/messagecoreutil.cpp --- a/messagecore/src/messagecoreutil.cpp +++ b/messagecore/src/messagecoreutil.cpp @@ -61,8 +61,13 @@ mQuoteLevel3DefaultTextColor = base.lighter(140); } - mPgpEncryptedMessageColor = QColor(0x00, 0x80, 0xFF); - mPgpEncryptedTextColor = QColor(0xFF, 0xFF, 0xFF); // white + if (isLightTheme()) { + mPgpEncryptedMessageColor = QColor(0x00, 0x80, 0xFF).lighter(180); + mPgpEncryptedTextColor = QColor(0x00, 0x80, 0xFF).darker(200); + } else { + mPgpEncryptedMessageColor = QColor(0x00, 0x80, 0xFF).darker(300); + mPgpEncryptedTextColor = QColor(0x00, 0x80, 0xFF).lighter(170); + } mPgpSignedTrustedMessageColor = scheme.background(KColorScheme::PositiveBackground).color(); mPgpSignedTrustedTextColor = scheme.foreground(KColorScheme::PositiveText).color(); mPgpSignedUntrustedMessageColor = scheme.background(KColorScheme::NeutralBackground).color(); diff --git a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp --- a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp +++ b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp @@ -59,6 +59,7 @@ using namespace MessageViewer; Q_DECLARE_METATYPE(GpgME::DecryptionResult::Recipient) +Q_DECLARE_METATYPE(GpgME::Key) Q_DECLARE_METATYPE(const QGpgME::Protocol *) static const int SIG_FRAME_COL_UNDEF = 99; @@ -465,7 +466,7 @@ } c.insert(QStringLiteral("cryptoProto"), QVariant::fromValue(mp->mCryptoProto)); - if (mp->mDecryptRecipients.size() > 0) { + if (!mp->mDecryptRecipients.empty()) { c.insert(QStringLiteral("decryptedRecipients"), QVariant::fromValue(mp->mDecryptRecipients)); } diff --git a/messageviewer/src/messagepartthemes/default/messagepartrenderermanager.cpp b/messageviewer/src/messagepartthemes/default/messagepartrenderermanager.cpp --- a/messageviewer/src/messagepartthemes/default/messagepartrenderermanager.cpp +++ b/messageviewer/src/messagepartthemes/default/messagepartrenderermanager.cpp @@ -27,6 +27,7 @@ #include #include +#include #include @@ -39,6 +40,8 @@ Q_DECLARE_METATYPE(GpgME::DecryptionResult::Recipient) Q_DECLARE_METATYPE(const QGpgME::Protocol *) +Q_DECLARE_METATYPE(GpgME::Key) + // Read-only introspection of GpgME::DecryptionResult::Recipient object. GRANTLEE_BEGIN_LOOKUP(GpgME::DecryptionResult::Recipient) if (property == QStringLiteral("keyID")) { @@ -59,6 +62,24 @@ } } +// Read-only introspection of std::pair object. +namespace Grantlee { +template<> +inline QVariant TypeAccessor&>::lookUp(std::pair const &object, const QString &property) +{ + if (property == QStringLiteral("keyID")) { + return QString::fromLatin1(object.first.keyID()); + } + if (property == QStringLiteral("id")) { + return QString::fromLatin1(object.second.userID(0).id()); + } + if (property == QStringLiteral("mainID")) { + return QString::fromLatin1(object.second.keyID()); + } + return QVariant(); +} +} + namespace MessageViewer { class GlobalContext : public QObject { @@ -107,6 +128,7 @@ { Grantlee::registerMetaType(); Grantlee::registerMetaType(); + Grantlee::registerMetaType>(); m_engine = new GrantleeTheme::Engine; foreach (const auto &p, QCoreApplication::libraryPaths()) { m_engine->addPluginPath(p + QStringLiteral("/messageviewer")); diff --git a/messageviewer/src/messagepartthemes/default/templates/encryptedmessagepart.html b/messageviewer/src/messagepartthemes/default/templates/encryptedmessagepart.html --- a/messageviewer/src/messagepartthemes/default/templates/encryptedmessagepart.html +++ b/messageviewer/src/messagepartthemes/default/templates/encryptedmessagepart.html @@ -13,7 +13,25 @@ {% if block.inProgress %} {% i18n "Please wait while the message is being decrypted..." %} {% elif block.isDecryptable %} - {% i18n "Encrypted message" %} +
+ {% i18n "Encrypted message" %} + {% i18n "Show Details" %} +
+ {% else %} {% i18n "Encrypted message (decryption not possible)" %} {% if block.errorText %} @@ -30,11 +48,16 @@ {% else %}
{% if block.noSecKey %} - {% i18n "No secret key found to encrypt the message. It is encrypted for following keys:" %} + {% i18n "No secret key found to decrypt the message. The message is encrypted for the following keys:" %} + {% elif not block.inProgress %} {% i18n "Could not decrypt the data." %} {% endif %} diff --git a/messageviewer/src/viewer/urlhandlermanager.cpp b/messageviewer/src/viewer/urlhandlermanager.cpp --- a/messageviewer/src/viewer/urlhandlermanager.cpp +++ b/messageviewer/src/viewer/urlhandlermanager.cpp @@ -675,6 +675,12 @@ w->setShowSignatureDetails(false); w->update(MimeTreeParser::Force); return true; + } else if (urlPath == QLatin1String("showEncryptionDetails")) { + w->setHideEncryptionDetails(false); + return true; + } else if (urlPath == QLatin1String("hideEncryptionDetails")) { + w->setHideEncryptionDetails(true); + return true; } else if (urlPath == QLatin1String("showAttachmentQuicklist")) { w->setShowAttachmentQuicklist(false); return true; @@ -716,6 +722,10 @@ return i18n("Show signature details."); } else if (urlPath == QLatin1String("hideSignatureDetails")) { return i18n("Hide signature details."); + } else if (urlPath == QLatin1String("showEncryptionDetails")) { + return i18n("Show encryption details."); + } else if (urlPath == QLatin1String("hideEncryptionDetails")) { + return i18n("Hide encryption details."); } else if (urlPath == QLatin1String("showAttachmentQuicklist")) { return i18n("Hide attachment list."); } else if (urlPath == QLatin1String("hideAttachmentQuicklist")) { diff --git a/messageviewer/src/viewer/viewer_p.h b/messageviewer/src/viewer/viewer_p.h --- a/messageviewer/src/viewer/viewer_p.h +++ b/messageviewer/src/viewer/viewer_p.h @@ -393,6 +393,9 @@ /* show or hide the list that points to the attachments */ void setShowAttachmentQuicklist(bool showAttachmentQuicklist = true); + /* show or hide encryption details */ + void setHideEncryptionDetails(bool encDetails = true); + void scrollToAttachment(KMime::Content *node); void setUseFixedFont(bool useFixedFont); diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp --- a/messageviewer/src/viewer/viewer_p.cpp +++ b/messageviewer/src/viewer/viewer_p.cpp @@ -3025,6 +3025,11 @@ mViewer->executeHideShowAttachmentsScripts(mShowAttachmentQuicklist); } +void ViewerPrivate::setHideEncryptionDetails(bool encDetails) +{ + mViewer->executeHideShowEncryptionDetails(encDetails); +} + void ViewerPrivate::scrollToAttachment(KMime::Content *node) { const QString indexStr = node->index().toString(); diff --git a/messageviewer/src/viewer/webengine/mailwebenginescript.h b/messageviewer/src/viewer/webengine/mailwebenginescript.h --- a/messageviewer/src/viewer/webengine/mailwebenginescript.h +++ b/messageviewer/src/viewer/webengine/mailwebenginescript.h @@ -29,6 +29,7 @@ MESSAGEVIEWER_EXPORT QString manageShowHideAttachments(bool hide); MESSAGEVIEWER_EXPORT QString manageShowHideToAddress(bool hide); MESSAGEVIEWER_EXPORT QString manageShowHideCcAddress(bool hide); +MESSAGEVIEWER_EXPORT QString manageShowHideEncryptionDetails(bool hide); MESSAGEVIEWER_EXPORT QString createShowHideAddressScript(const QString &field, bool hide); } } diff --git a/messageviewer/src/viewer/webengine/mailwebenginescript.cpp b/messageviewer/src/viewer/webengine/mailwebenginescript.cpp --- a/messageviewer/src/viewer/webengine/mailwebenginescript.cpp +++ b/messageviewer/src/viewer/webengine/mailwebenginescript.cpp @@ -70,6 +70,19 @@ return source; } +QString MailWebEngineScript::manageShowHideEncryptionDetails(bool hide) +{ + QString source = checkJQuery("manageShowHideEncryptionDetails"); + if (hide) { + source += QString::fromLatin1("qt.jQuery(\".enc-details\").hide();" + "qt.jQuery(\".enc-simple\").show();"); + } else { + source += QString::fromLatin1("qt.jQuery('.enc-simple').hide();" + "qt.jQuery(\".enc-details\").show();"); + } + return source; +} + QString MailWebEngineScript::injectAttachments(const QString &delayedHtml, const QString &elementStr) { const QString source = checkJQuery("injectAttachments") + QString::fromLatin1( diff --git a/messageviewer/src/viewer/webengine/mailwebengineview.h b/messageviewer/src/viewer/webengine/mailwebengineview.h --- a/messageviewer/src/viewer/webengine/mailwebengineview.h +++ b/messageviewer/src/viewer/webengine/mailwebengineview.h @@ -67,6 +67,7 @@ void executeHideShowAttachmentsScripts(bool hide); void executeHideShowToAddressScripts(bool hide); void executeHideShowCcAddressScripts(bool hide); + void executeHideShowEncryptionDetails(bool hide); void setLinkHovered(const QUrl &url); void setViewer(MessageViewer::ViewerPrivate *viewer); bool execPrintPreviewPage(QPrinter *printer, int timeout); diff --git a/messageviewer/src/viewer/webengine/mailwebengineview.cpp b/messageviewer/src/viewer/webengine/mailwebengineview.cpp --- a/messageviewer/src/viewer/webengine/mailwebengineview.cpp +++ b/messageviewer/src/viewer/webengine/mailwebengineview.cpp @@ -349,6 +349,12 @@ runJavaScriptInWordId(source); } +void MailWebEngineView::executeHideShowEncryptionDetails(bool hide) +{ + const QString source = MessageViewer::MailWebEngineScript::manageShowHideEncryptionDetails(hide); + runJavaScriptInWordId(source); +} + void MailWebEngineView::executeHideShowCcAddressScripts(bool hide) { const QString source = MessageViewer::MailWebEngineScript::manageShowHideCcAddress(hide); diff --git a/mimetreeparser/autotests/data/details/forward-openpgp-signed-encrypted.mbox.html b/mimetreeparser/autotests/data/details/forward-openpgp-signed-encrypted.mbox.html --- a/mimetreeparser/autotests/data/details/forward-openpgp-signed-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/details/forward-openpgp-signed-encrypted.mbox.html @@ -25,7 +25,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/openpgp-encrypted+signed.mbox.html b/mimetreeparser/autotests/data/details/openpgp-encrypted+signed.mbox.html --- a/mimetreeparser/autotests/data/details/openpgp-encrypted+signed.mbox.html +++ b/mimetreeparser/autotests/data/details/openpgp-encrypted+signed.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/details/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/details/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/details/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/openpgp-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/details/openpgp-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/details/openpgp-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/details/openpgp-encrypted-attachment.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/openpgp-encrypted-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/details/openpgp-encrypted-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/details/openpgp-encrypted-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/details/openpgp-encrypted-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/openpgp-encrypted-partially-signed-attachments.mbox.html b/mimetreeparser/autotests/data/details/openpgp-encrypted-partially-signed-attachments.mbox.html --- a/mimetreeparser/autotests/data/details/openpgp-encrypted-partially-signed-attachments.mbox.html +++ b/mimetreeparser/autotests/data/details/openpgp-encrypted-partially-signed-attachments.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
@@ -79,7 +82,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/openpgp-inline-charset-encrypted.mbox.html b/mimetreeparser/autotests/data/details/openpgp-inline-charset-encrypted.mbox.html --- a/mimetreeparser/autotests/data/details/openpgp-inline-charset-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/details/openpgp-inline-charset-encrypted.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/openpgp-signed-encrypted-two-attachments.mbox.html b/mimetreeparser/autotests/data/details/openpgp-signed-encrypted-two-attachments.mbox.html --- a/mimetreeparser/autotests/data/details/openpgp-signed-encrypted-two-attachments.mbox.html +++ b/mimetreeparser/autotests/data/details/openpgp-signed-encrypted-two-attachments.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/openpgp-signed-encrypted.mbox.html b/mimetreeparser/autotests/data/details/openpgp-signed-encrypted.mbox.html --- a/mimetreeparser/autotests/data/details/openpgp-signed-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/details/openpgp-signed-encrypted.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/signed-forward-openpgp-signed-encrypted.mbox.html b/mimetreeparser/autotests/data/details/signed-forward-openpgp-signed-encrypted.mbox.html --- a/mimetreeparser/autotests/data/details/signed-forward-openpgp-signed-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/details/signed-forward-openpgp-signed-encrypted.mbox.html @@ -45,7 +45,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/smime-opaque-enc+sign.mbox.html b/mimetreeparser/autotests/data/details/smime-opaque-enc+sign.mbox.html --- a/mimetreeparser/autotests/data/details/smime-opaque-enc+sign.mbox.html +++ b/mimetreeparser/autotests/data/details/smime-opaque-enc+sign.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/details/smime-signed-encrypted.mbox.html b/mimetreeparser/autotests/data/details/smime-signed-encrypted.mbox.html --- a/mimetreeparser/autotests/data/details/smime-signed-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/details/smime-signed-encrypted.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/forward-openpgp-signed-encrypted.mbox.html b/mimetreeparser/autotests/data/forward-openpgp-signed-encrypted.mbox.html --- a/mimetreeparser/autotests/data/forward-openpgp-signed-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/forward-openpgp-signed-encrypted.mbox.html @@ -25,7 +25,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-attachment.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-partially-signed-attachments.mbox.html b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-partially-signed-attachments.mbox.html --- a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-partially-signed-attachments.mbox.html +++ b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-partially-signed-attachments.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
@@ -59,7 +62,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-two-attachments.mbox.html b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-two-attachments.mbox.html --- a/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-two-attachments.mbox.html +++ b/mimetreeparser/autotests/data/headeronly/openpgp-encrypted-two-attachments.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/headeronly/openpgp-signed-encrypted-two-attachments.mbox.html b/mimetreeparser/autotests/data/headeronly/openpgp-signed-encrypted-two-attachments.mbox.html --- a/mimetreeparser/autotests/data/headeronly/openpgp-signed-encrypted-two-attachments.mbox.html +++ b/mimetreeparser/autotests/data/headeronly/openpgp-signed-encrypted-two-attachments.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-attachment.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-partially-signed-attachments.mbox.html b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-partially-signed-attachments.mbox.html --- a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-partially-signed-attachments.mbox.html +++ b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-partially-signed-attachments.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
@@ -59,7 +62,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-two-attachments.mbox.html b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-two-attachments.mbox.html --- a/mimetreeparser/autotests/data/hidden/openpgp-encrypted-two-attachments.mbox.html +++ b/mimetreeparser/autotests/data/hidden/openpgp-encrypted-two-attachments.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/hidden/openpgp-signed-encrypted-two-attachments.mbox.html b/mimetreeparser/autotests/data/hidden/openpgp-signed-encrypted-two-attachments.mbox.html --- a/mimetreeparser/autotests/data/hidden/openpgp-signed-encrypted-two-attachments.mbox.html +++ b/mimetreeparser/autotests/data/hidden/openpgp-signed-encrypted-two-attachments.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/iconic/openpgp-encrypted-partially-signed-attachments.mbox.html b/mimetreeparser/autotests/data/iconic/openpgp-encrypted-partially-signed-attachments.mbox.html --- a/mimetreeparser/autotests/data/iconic/openpgp-encrypted-partially-signed-attachments.mbox.html +++ b/mimetreeparser/autotests/data/iconic/openpgp-encrypted-partially-signed-attachments.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
@@ -67,7 +70,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/iconic/openpgp-encrypted-two-attachments.mbox.html b/mimetreeparser/autotests/data/iconic/openpgp-encrypted-two-attachments.mbox.html --- a/mimetreeparser/autotests/data/iconic/openpgp-encrypted-two-attachments.mbox.html +++ b/mimetreeparser/autotests/data/iconic/openpgp-encrypted-two-attachments.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/iconic/openpgp-signed-encrypted-two-attachments.mbox.html b/mimetreeparser/autotests/data/iconic/openpgp-signed-encrypted-two-attachments.mbox.html --- a/mimetreeparser/autotests/data/iconic/openpgp-signed-encrypted-two-attachments.mbox.html +++ b/mimetreeparser/autotests/data/iconic/openpgp-signed-encrypted-two-attachments.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/inlined/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/inlined/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/inlined/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/inlined/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/inlined/openpgp-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/inlined/openpgp-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/inlined/openpgp-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/inlined/openpgp-encrypted-attachment.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/inlined/openpgp-encrypted-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/inlined/openpgp-encrypted-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/inlined/openpgp-encrypted-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/inlined/openpgp-encrypted-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/inlinepgpencrypted-appendix.mbox.html b/mimetreeparser/autotests/data/inlinepgpencrypted-appendix.mbox.html --- a/mimetreeparser/autotests/data/inlinepgpencrypted-appendix.mbox.html +++ b/mimetreeparser/autotests/data/inlinepgpencrypted-appendix.mbox.html @@ -7,7 +7,10 @@
- + diff --git a/mimetreeparser/autotests/data/inlinepgpencrypted.mbox.html b/mimetreeparser/autotests/data/inlinepgpencrypted.mbox.html --- a/mimetreeparser/autotests/data/inlinepgpencrypted.mbox.html +++ b/mimetreeparser/autotests/data/inlinepgpencrypted.mbox.html @@ -7,7 +7,10 @@
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/inlinepgpencrypted-error.mbox.html b/mimetreeparser/autotests/data/inlinepgpencrypted-error.mbox.html --- a/mimetreeparser/autotests/data/inlinepgpencrypted-error.mbox.html +++ b/mimetreeparser/autotests/data/inlinepgpencrypted-error.mbox.html @@ -11,7 +11,7 @@
-
No secret key found to encrypt the message. It is encrypted for following keys:
0x553D4262DA4BADF2
0xF6E6A3D126C630E0
+
No secret key found to decrypt the message. The message is encrypted for the following keys:
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-encrypted+signed.mbox.html b/mimetreeparser/autotests/data/openpgp-encrypted+signed.mbox.html --- a/mimetreeparser/autotests/data/openpgp-encrypted+signed.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-encrypted+signed.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-encrypted-applemail.mbox.html b/mimetreeparser/autotests/data/openpgp-encrypted-applemail.mbox.html --- a/mimetreeparser/autotests/data/openpgp-encrypted-applemail.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-encrypted-applemail.mbox.html @@ -11,7 +11,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-encrypted-attachment-and-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/openpgp-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/openpgp-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-encrypted-attachment.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-encrypted-enigmail1.6.mbox.html b/mimetreeparser/autotests/data/openpgp-encrypted-enigmail1.6.mbox.html --- a/mimetreeparser/autotests/data/openpgp-encrypted-enigmail1.6.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-encrypted-enigmail1.6.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-encrypted-non-encrypted-attachment.mbox.html b/mimetreeparser/autotests/data/openpgp-encrypted-non-encrypted-attachment.mbox.html --- a/mimetreeparser/autotests/data/openpgp-encrypted-non-encrypted-attachment.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-encrypted-non-encrypted-attachment.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-encrypted-partially-signed-attachments.mbox.html b/mimetreeparser/autotests/data/openpgp-encrypted-partially-signed-attachments.mbox.html --- a/mimetreeparser/autotests/data/openpgp-encrypted-partially-signed-attachments.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-encrypted-partially-signed-attachments.mbox.html @@ -9,7 +9,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
@@ -76,7 +79,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-encrypted-two-attachments.mbox.html b/mimetreeparser/autotests/data/openpgp-encrypted-two-attachments.mbox.html --- a/mimetreeparser/autotests/data/openpgp-encrypted-two-attachments.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-encrypted-two-attachments.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-encrypted.mbox.html b/mimetreeparser/autotests/data/openpgp-encrypted.mbox.html --- a/mimetreeparser/autotests/data/openpgp-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-encrypted.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-inline-charset-encrypted.mbox.html b/mimetreeparser/autotests/data/openpgp-inline-charset-encrypted.mbox.html --- a/mimetreeparser/autotests/data/openpgp-inline-charset-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-inline-charset-encrypted.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-inline-wrong-charset-encrypted.mbox.html b/mimetreeparser/autotests/data/openpgp-inline-wrong-charset-encrypted.mbox.html --- a/mimetreeparser/autotests/data/openpgp-inline-wrong-charset-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-inline-wrong-charset-encrypted.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-signed-encrypted-two-attachments.mbox.html b/mimetreeparser/autotests/data/openpgp-signed-encrypted-two-attachments.mbox.html --- a/mimetreeparser/autotests/data/openpgp-signed-encrypted-two-attachments.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-signed-encrypted-two-attachments.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/openpgp-signed-encrypted.mbox.html b/mimetreeparser/autotests/data/openpgp-signed-encrypted.mbox.html --- a/mimetreeparser/autotests/data/openpgp-signed-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/openpgp-signed-encrypted.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/signed-forward-openpgp-signed-encrypted.mbox.html b/mimetreeparser/autotests/data/signed-forward-openpgp-signed-encrypted.mbox.html --- a/mimetreeparser/autotests/data/signed-forward-openpgp-signed-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/signed-forward-openpgp-signed-encrypted.mbox.html @@ -42,7 +42,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/smime-encrypted-octet-stream.mbox.html b/mimetreeparser/autotests/data/smime-encrypted-octet-stream.mbox.html --- a/mimetreeparser/autotests/data/smime-encrypted-octet-stream.mbox.html +++ b/mimetreeparser/autotests/data/smime-encrypted-octet-stream.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/smime-encrypted.mbox.html b/mimetreeparser/autotests/data/smime-encrypted.mbox.html --- a/mimetreeparser/autotests/data/smime-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/smime-encrypted.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/smime-opaque-enc+sign.mbox.html b/mimetreeparser/autotests/data/smime-opaque-enc+sign.mbox.html --- a/mimetreeparser/autotests/data/smime-opaque-enc+sign.mbox.html +++ b/mimetreeparser/autotests/data/smime-opaque-enc+sign.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/autotests/data/smime-signed-encrypted.mbox.html b/mimetreeparser/autotests/data/smime-signed-encrypted.mbox.html --- a/mimetreeparser/autotests/data/smime-signed-encrypted.mbox.html +++ b/mimetreeparser/autotests/data/smime-signed-encrypted.mbox.html @@ -7,7 +7,10 @@
- +
Encrypted message +
Encrypted messageShow Details
+ +
diff --git a/mimetreeparser/src/viewer/messagepart.h b/mimetreeparser/src/viewer/messagepart.h --- a/mimetreeparser/src/viewer/messagepart.h +++ b/mimetreeparser/src/viewer/messagepart.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -371,7 +372,7 @@ QString mFromAddress; bool mDecryptMessage; QByteArray mVerifiedText; - std::vector mDecryptRecipients; + std::vector> mDecryptRecipients; friend class DefaultRendererPrivate; }; diff --git a/mimetreeparser/src/viewer/messagepart.cpp b/mimetreeparser/src/viewer/messagepart.cpp --- a/mimetreeparser/src/viewer/messagepart.cpp +++ b/mimetreeparser/src/viewer/messagepart.cpp @@ -921,7 +921,7 @@ if (partMetaData()->isGoodSignature && !key.keyID()) { // Search for the key by its fingerprint so that we can check for // trust etc. - QGpgME::KeyListJob *job = mCryptoProto->keyListJob(false); // local, no sigs + QGpgME::KeyListJob *job = mCryptoProto->keyListJob(false, false, false); // local, no sigs if (!job) { qCDebug(MIMETREEPARSER_LOG) << "The Crypto backend does not support listing keys. "; } else { @@ -1220,7 +1220,32 @@ appendSubPart(subPart); } - mDecryptRecipients = decryptResult.recipients(); + mDecryptRecipients.clear(); + for (const auto &recipient : decryptResult.recipients()) { + GpgME::Key key; + QGpgME::KeyListJob *job = mCryptoProto->keyListJob(false, false, false); // local, no sigs + if (!job) { + qCDebug(MIMETREEPARSER_LOG) << "The Crypto backend does not support listing keys. "; + } else { + std::vector found_keys; + // As we are local it is ok to make this synchronous + GpgME::KeyListResult res = job->exec(QStringList(QLatin1String(recipient.keyID())), false, found_keys); + if (res.error()) { + qCDebug(MIMETREEPARSER_LOG) << "Error while searching key for Fingerprint: " << recipient.keyID(); + } + if (found_keys.size() > 1) { + // Should not Happen + qCDebug(MIMETREEPARSER_LOG) << "Oops: Found more then one Key for Fingerprint: " << recipient.keyID(); + } + if (found_keys.size() != 1) { + // Should not Happen at this point + qCDebug(MIMETREEPARSER_LOG) << "Oops: Found no Key for Fingerprint: " << recipient.keyID(); + } else { + key = found_keys[0]; + } + } + mDecryptRecipients.push_back(std::make_pair(recipient, key)); + } bDecryptionOk = !decryptResult.error(); // std::stringstream ss; // ss << decryptResult << '\n' << verifyResult;