We can autodetect if, the content of an mimepart is pgp encrypted.
The problem at the moment, is that we display directly every
EncryptedMessagePart, what is okay for text content but not for
everything else.
BUG: 324365
FIXED-IN: 17.12.0
vkrause |
KDE PIM |
We can autodetect if, the content of an mimepart is pgp encrypted.
The problem at the moment, is that we display directly every
EncryptedMessagePart, what is okay for text content but not for
everything else.
BUG: 324365
FIXED-IN: 17.12.0
make sure , that attatchment are still handled as attachments and not as "normal" text.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
currently this patch restults with:
--- /home/neon/kdepim/src/kde/pim/messagelib/mimetreeparser/autotests/data/openpgp-inline-encrypted-with-attachment.mbox.tree 2017-10-30 11:13:47.986867617 +0000 +++ openpgp-inline-encrypted-with-attachment.mbox.out.tree 2017-10-30 11:14:42.058920933 +0000 @@ -3,5 +3,6 @@ * MimeTreeParser::TextMessagePart * MimeTreeParser::EncryptedMessagePart * MimeTreeParser::SignedMessagePart - * MimeTreeParser::AttachmentMessagePart - * MimeTreeParser::MessagePart + * MimeTreeParser::EncryptedMessagePart + * MimeTreeParser::TextMessagePart <-- here MimeTreeParser::AttachmentMessagePart would be correct + * MimeTreeParser::MessagePart FAIL! : RenderTest::testRenderSmart(openpgp-inline-encrypted-with-attachment.mbox) Compared values are not the same Actual (proc.exitCode()): 1 Expected (0) : 0 Loc: [/home/neon/kdepim/src/kde/pim/messagelib/messageviewer/src/messagepartthemes/default/autotests/rendertest.cpp(295)] --- /home/neon/kdepim/src/kde/pim/messagelib/mimetreeparser/autotests/data/openpgp-inline-encrypted-with-attachment.mbox.html 2017-10-30 11:13:37.482856527 +0000 +++ openpgp-inline-encrypted-with-attachment.mbox.out.html 2017-10-30 11:14:42.066920940 +0000 @@ -51,11 +51,31 @@ </div> <a name="att2"/> <div id="attachmentDiv2"> - <hr/> - <div> - <a href="attachment:2?place=body"><img align="center" height="48" width="48" src="file:text-plain.svg" border="0" style="max-width: 100%" alt=""/>attachment.asc</a> - </div> - <div/> + <table cellspacing="1" cellpadding="1" class="encr"> + <tr class="encrH"> + <td dir="ltr"> + <div class="enc-simple">Encrypted message<a href="kmail:showEncryptionDetails" style="display:block;float:right;">Show Details</a></div> + <div class="enc-details" style="display:none;">The message is encrypted for the following keys:<a href="kmail:hideEncryptionDetails" style="display:block;float:right;">Hide Details</a><ul style="list-style-type: none;"><li>unittest key (no password) <test@kolab.org> (<a href="kmail:showCertificate#gpg ### OpenPGP ### 8D9860C58F246DE6">0x8D9860C58F246DE6</a>)</li></ul></div> + </td> + </tr> + <tr class="encrB"> + <td> + <div style="position: relative; word-wrap: break-word"> + <a name="att"/> + <div id="attachmentDiv"> + <div class="noquote"> + <div dir="ltr">asfsadfsdaf</div> + <br/> + <div dir="ltr">asdfasdfasdf</div> + </div> + </div> + </div> + </td> + </tr> + <tr class="encrH"> + <td dir="ltr">End of encrypted message</td> + </tr> + </table> </div> </div> </div> FAIL! : RenderTest::testRenderSmart(openpgp-inline-encrypted-with-attachment.mbox) Compared values are not the same Actual (proc.exitCode()): 1 Expected (0) : 0
update patch to work like expected (mostly).
I'm a little bit unhappy about the display for iconic and hidden attachment style.
Also the attachment file name should be "smarter" like remove pgp at the end etc.
@vkrause: IMO it is ready for release- it is not perfect, but for smarter attachment control we need to rework the attachmentstrategy to know extracontent etc.