Commit b7a354ea authored by Sandro Knauß's avatar Sandro Knauß
Browse files

MimeTreeParser: fix protected headers for signed messages.

parent 9cc496e7
......@@ -74,7 +74,7 @@ MessagePart::Ptr MultiPartSignedBodyPartFormatter::process(Interface::BodyPart &
const QTextCodec *aCodec(part.objectTreeParser()->codecFor(signedData));
SignedMessagePart::Ptr mp(
new SignedMessagePart(part.objectTreeParser(), aCodec->toUnicode(cleartext), protocol, part.nodeHelper()->fromAsString(node), signature));
new SignedMessagePart(part.objectTreeParser(), aCodec->toUnicode(cleartext), protocol, part.nodeHelper()->fromAsString(node), signedData));
mp->startVerificationDetached(cleartext, signedData, signature->decodedContent());
part.nodeHelper()->registerOverrideHeader(node, mp);
......
......@@ -1033,27 +1033,24 @@ QString SignedMessagePart::fromAddress() const
bool SignedMessagePart::hasHeader(const char *headerType) const
{
const auto extraContent = mOtp->nodeHelper()->decryptedNodeForContent(content());
if (extraContent) {
return extraContent->hasHeader(headerType);
if(content()) {
return content()->hasHeader(headerType);
}
return false;
}
const KMime::Headers::Base* MimeTreeParser::SignedMessagePart::header(const char* headerType) const
{
const auto extraContent = mOtp->nodeHelper()->decryptedNodeForContent(content());
if (extraContent) {
return extraContent->headerByType(headerType);
if(content()) {
return content()->headerByType(headerType);
}
return nullptr;
}
QVector<KMime::Headers::Base *> SignedMessagePart::headers(const char* headerType) const
{
const auto extraContent = mOtp->nodeHelper()->decryptedNodeForContent(content());
if (extraContent) {
return extraContent->headersByType(headerType);
if(content()) {
return content()->headersByType(headerType);
}
return QVector<KMime::Headers::Base *>();
}
......
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