Commit 2320bf2c authored by VDVsx's avatar VDVsx

Merge pull request #76 from nemomobile-packages/multipartSigned

[qmf] Correctly handle multipart/signed parts
parents eed9fc0c a8f6fda9
......@@ -1047,6 +1047,9 @@ namespace findBody
case QMailMessagePart::MultipartNone:
return inMultipartNone(part, ctx);
case QMailMessagePart::MultipartMixed:
return inMultipartMixed(part, ctx);
case QMailMessagePart::MultipartAlternative:
return inMultipartAlternative(part, ctx);
......@@ -1150,9 +1153,12 @@ namespace findAttachments
if (found) {
found->clear();
}
if (container.multipartType() == QMailMessagePart::MultipartMixed)
if (container.multipartType() == QMailMessagePart::MultipartMixed) {
inMultipartMixed(container, found, hasAttachments);
}
if (container.multipartType() == QMailMessagePart::MultipartSigned) {
inMultipartSigned(container, found, hasAttachments);
}
// In any case, the default strategy wins, even if there are no attachments
return true;
}
......@@ -1208,6 +1214,24 @@ namespace findAttachments
}
}
}
void inMultipartSigned(const QMailMessagePartContainer &container,
Locations* found,
bool* hasAttachments) const
{
for (uint i = 0; i < container.partCount(); i++) {
const QMailMessagePart &part = container.partAt(i);
switch (part.multipartType()) {
case QMailMessagePart::MultipartNone:
inMultipartNone(part, found, hasAttachments);
break;
default:
// Default to handling as MultipartMixed
inMultipartMixed(part, found, hasAttachments);
break;
}
}
}
};
class TnefAttachmentFindStrategy : public AttachmentFindStrategy
......
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