summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2022-10-09 18:57:43 +0200
committerSlávek Banko <slavek.banko@axis.cz>2022-10-14 09:55:44 +0200
commitb1ef270c6158415d61fd95190281c1a498b2b4ec (patch)
treec68cf3ac89bf763a06ea92758af16c4a73121a07
parent2b133a2d1dac61d13416bac3ac6b40f029e53c8c (diff)
downloadtdepim-b1ef270c6158415d61fd95190281c1a498b2b4ec.tar.gz
tdepim-b1ef270c6158415d61fd95190281c1a498b2b4ec.zip
Load external references in encrypted emails only on explicit request.
Taken from KDE patches and adapted to TDE. See https://phabricator.kde.org/D12391 Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 746e02af07f7dc223940ad80a0a234c0aff85850)
-rw-r--r--kmail/kmreaderwin.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp
index 1bd31129e..a8153393d 100644
--- a/kmail/kmreaderwin.cpp
+++ b/kmail/kmreaderwin.cpp
@@ -1401,8 +1401,6 @@ void KMReaderWin::updateReaderWin()
{
if (!mMsgDisplay) return;
- mViewer->setOnlyLocalReferences(!htmlLoadExternal());
-
htmlWriter()->reset();
KMFolder* folder = 0;
@@ -1565,6 +1563,7 @@ void KMReaderWin::parseMsg(KMMessage* aMsg)
// - this can only be done *after* calling parseObjectTree()
KMMsgEncryptionState encryptionState = mRootNode->overallEncryptionState();
KMMsgSignatureState signatureState = mRootNode->overallSignatureState();
+ mViewer->setOnlyLocalReferences(!htmlLoadExternal());
// Don't crash when switching message while GPG passphrase entry dialog is shown #53185
if (aMsg != message()) {
displayMessage();
@@ -2490,8 +2489,19 @@ bool KMReaderWin::htmlMail()
//-----------------------------------------------------------------------------
bool KMReaderWin::htmlLoadExternal()
{
- return ((mHtmlLoadExternal && !mHtmlLoadExtOverride) ||
- (!mHtmlLoadExternal && mHtmlLoadExtOverride));
+ if (!mRootNode)
+ {
+ return mHtmlLoadExtOverride;
+ }
+
+ // when displaying an encrypted message, only load external resources on explicit request
+ if (mRootNode->overallEncryptionState() != KMMsgNotEncrypted)
+ {
+ return mHtmlLoadExtOverride;
+ }
+
+ return ((mHtmlLoadExternal && !mHtmlLoadExtOverride) ||
+ (!mHtmlLoadExternal && mHtmlLoadExtOverride));
}