Commit 526f6167 authored by Sandro Knauß's avatar Sandro Knauß

Also search for encrypted and signed parts in extendedContents.

Fixes the last QEXPECED_FAIL occurences.
parent f1b743e0
......@@ -95,10 +95,7 @@ void UnencryptedMessageTest::testForwardedOpenPGPSignedEncrypted()
QCOMPARE(otp.plainTextContent().toLatin1().data(), "bla bla bla"); // The textual content doesn't include the encrypted encapsulated message by design
QCOMPARE(nodeHelper.overallEncryptionState(originalMessage.data()), KMMsgPartiallyEncrypted);
// Signature state handling is broken. First, the state is apparently not calculated correctly,
// and then the state is never stored somewhere so it can't be remembered.
QEXPECT_FAIL("", "Signature state handling broken!", Continue);
QVERIFY(nodeHelper.overallSignatureState(originalMessage.data()) != KMMsgNotSigned);
QCOMPARE(nodeHelper.overallSignatureState(originalMessage.data()), KMMsgPartiallySigned);
// Now, test that the unencrypted message is generated correctly
KMime::Message::Ptr unencryptedMessage = nodeHelper.unencryptedMessage(originalMessage);
......@@ -131,10 +128,7 @@ void UnencryptedMessageTest::testSMIMESignedEncrypted()
QCOMPARE(otp.plainTextContent().toLatin1().data(), "encrypted message text");
QCOMPARE(nodeHelper.overallEncryptionState(originalMessage.data()), KMMsgFullyEncrypted);
// Signature state handling is broken. First, the state is apparently not calculated correctly,
// and then the state is never stored somewhere so it can't be remembered.
QEXPECT_FAIL("", "Signature state handling broken!", Continue);
QVERIFY(nodeHelper.overallSignatureState(originalMessage.data()) != KMMsgNotSigned);
QCOMPARE(nodeHelper.overallSignatureState(originalMessage.data()), KMMsgFullySigned);
// Now, test that the unencrypted message is generated correctly
KMime::Message::Ptr unencryptedMessage = nodeHelper.unencryptedMessage(originalMessage);
......@@ -160,10 +154,7 @@ void UnencryptedMessageTest::testOpenPGPSignedEncrypted()
QCOMPARE(otp.plainTextContent().toLatin1().data(), "encrypted message text");
QCOMPARE(nodeHelper.overallEncryptionState(originalMessage.data()), KMMsgFullyEncrypted);
// Signature state handling is broken. First, the state is apparently not calculated correctly,
// and then the state is never stored somewhere so it can't be remembered.
QEXPECT_FAIL("", "Signature state handling broken!", Continue);
QVERIFY(nodeHelper.overallSignatureState(originalMessage.data()) != KMMsgNotSigned);
QCOMPARE(nodeHelper.overallSignatureState(originalMessage.data()), KMMsgFullySigned);
// Now, test that the unencrypted message is generated correctly
KMime::Message::Ptr unencryptedMessage = nodeHelper.unencryptedMessage(originalMessage);
......
......@@ -370,6 +370,10 @@ KMMsgEncryptionState NodeHelper::overallEncryptionState(KMime::Content *node) co
otherState = overallEncryptionState(next->contents().at(0));
}
if (otherState == KMMsgNotEncrypted && !extraContents(next).isEmpty()) {
otherState = overallEncryptionState(extraContents(next).at(0));
}
if (next == node) {
myState = otherState;
}
......@@ -424,6 +428,10 @@ KMMsgSignatureState NodeHelper::overallSignatureState(KMime::Content *node) cons
otherState = overallSignatureState(next->contents().at(0));
}
if (otherState == KMMsgNotSigned && !extraContents(next).isEmpty()) {
otherState = overallSignatureState(extraContents(next).at(0));
}
if (next == node) {
myState = otherState;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment