diff options
-rw-r--r-- | framework/src/domain/mime/mimetreeparser/messagepart.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/framework/src/domain/mime/mimetreeparser/messagepart.cpp b/framework/src/domain/mime/mimetreeparser/messagepart.cpp index 204681b6..2c95864c 100644 --- a/framework/src/domain/mime/mimetreeparser/messagepart.cpp +++ b/framework/src/domain/mime/mimetreeparser/messagepart.cpp | |||
@@ -52,10 +52,10 @@ using namespace MimeTreeParser; | |||
52 | MessagePart::MessagePart(ObjectTreeParser *otp, const QString &text, KMime::Content *node) | 52 | MessagePart::MessagePart(ObjectTreeParser *otp, const QString &text, KMime::Content *node) |
53 | : mText(text) | 53 | : mText(text) |
54 | , mOtp(otp) | 54 | , mOtp(otp) |
55 | , mNode(node) //only null for messagepartlist | ||
56 | , mParentPart(nullptr) | 55 | , mParentPart(nullptr) |
57 | , mRoot(false) | 56 | , mNode(node) //only null for messagepartlist |
58 | , mError(NoError) | 57 | , mError(NoError) |
58 | , mRoot(false) | ||
59 | { | 59 | { |
60 | } | 60 | } |
61 | 61 | ||
@@ -702,8 +702,6 @@ bool SignedMessagePart::isSigned() const | |||
702 | 702 | ||
703 | bool SignedMessagePart::okVerify(const QByteArray &data, const QByteArray &signature, KMime::Content *textNode) | 703 | bool SignedMessagePart::okVerify(const QByteArray &data, const QByteArray &signature, KMime::Content *textNode) |
704 | { | 704 | { |
705 | NodeHelper *nodeHelper = mOtp->nodeHelper(); | ||
706 | |||
707 | mMetaData.isSigned = false; | 705 | mMetaData.isSigned = false; |
708 | mMetaData.keyTrust = GpgME::Signature::Unknown; | 706 | mMetaData.keyTrust = GpgME::Signature::Unknown; |
709 | mMetaData.status = tr("Wrong Crypto Plug-In."); | 707 | mMetaData.status = tr("Wrong Crypto Plug-In."); |
@@ -905,7 +903,6 @@ void SignedMessagePart::startVerification() | |||
905 | { | 903 | { |
906 | if (mSignedData) { | 904 | if (mSignedData) { |
907 | const QByteArray cleartext = KMime::LFtoCRLF(mSignedData->encodedContent()); | 905 | const QByteArray cleartext = KMime::LFtoCRLF(mSignedData->encodedContent()); |
908 | const QTextCodec *aCodec(mOtp->codecFor(mSignedData)); | ||
909 | 906 | ||
910 | //The case for pkcs7 | 907 | //The case for pkcs7 |
911 | if (mNode == mSignedData) { | 908 | if (mNode == mSignedData) { |
@@ -1048,17 +1045,18 @@ void EncryptedMessagePart::startDecryption(const QByteArray &text, const QTextCo | |||
1048 | 1045 | ||
1049 | startDecryption(content); | 1046 | startDecryption(content); |
1050 | 1047 | ||
1051 | auto code = aCodec ? aCodec : mOtp->codecFor(mNode); | ||
1052 | if (!mMetaData.inProgress && mMetaData.isDecryptable) { | 1048 | if (!mMetaData.inProgress && mMetaData.isDecryptable) { |
1049 | const auto codec = aCodec ? aCodec : mOtp->codecFor(mNode); | ||
1050 | const auto decoded = codec->toUnicode(mDecryptedData); | ||
1053 | if (hasSubParts()) { | 1051 | if (hasSubParts()) { |
1054 | auto _mp = (subParts()[0]).dynamicCast<SignedMessagePart>(); | 1052 | auto _mp = (subParts()[0]).dynamicCast<SignedMessagePart>(); |
1055 | if (_mp) { | 1053 | if (_mp) { |
1056 | _mp->setText(aCodec->toUnicode(mDecryptedData)); | 1054 | _mp->setText(decoded); |
1057 | } else { | 1055 | } else { |
1058 | setText(aCodec->toUnicode(mDecryptedData)); | 1056 | setText(decoded); |
1059 | } | 1057 | } |
1060 | } else { | 1058 | } else { |
1061 | setText(aCodec->toUnicode(mDecryptedData)); | 1059 | setText(decoded); |
1062 | } | 1060 | } |
1063 | } | 1061 | } |
1064 | } | 1062 | } |
@@ -1072,7 +1070,6 @@ bool EncryptedMessagePart::okDecryptMIME(KMime::Content &data) | |||
1072 | mMetaData.errorText.clear(); | 1070 | mMetaData.errorText.clear(); |
1073 | mMetaData.auditLogError = GpgME::Error(); | 1071 | mMetaData.auditLogError = GpgME::Error(); |
1074 | mMetaData.auditLog.clear(); | 1072 | mMetaData.auditLog.clear(); |
1075 | NodeHelper *nodeHelper = mOtp->nodeHelper(); | ||
1076 | 1073 | ||
1077 | if (!mCryptoProto) { | 1074 | if (!mCryptoProto) { |
1078 | mError = UnknownError; | 1075 | mError = UnknownError; |