Show the user that we are missing a secrect key to decrypt instead of
a general error message.
Details
- Reviewers
mlaurent aheinecke dvratil - Commits
- R94:0e19a836a07e: No Secret key = no decryption.
Diff Detail
- Repository
- R94 PIM: Message Library
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
This has also a visual change. With the patch the failed decryption looks like this:
instead to:
Both my comments are just suggestions ship it as is if you want as it already improves the situation imo.
Generally I would like to see such handling in libkleo so that we can unify it. I basically need the same code in Kleopatra where decryption failed with no secret key currently leads to the very useful error: "Decryption Failed: Decryption Failed." :-) Something to talk about next weekend in Toulouse I guess.
mimetreeparser/src/viewer/objecttreeparser.cpp | ||
---|---|---|
689 | Why auto? This always returns a vector of Recipients. | |
700 | Imo it would be more user friendly to show the primary UID there if it is available. This would mean to create a new context and use context->key to obtain the key and then include the first uid if it is available. If no key is available you could fallback to showing just the key id. You should do this in a second loop as it involves calls to gnupg or gpgsm. |
it is now commited but still some open questions
mimetreeparser/src/viewer/objecttreeparser.cpp | ||
---|---|---|
689 | Because i think it is easier to read without the long type defintion. I replaced the auto with the concrete type. But IMO we should discuss this in Toulouse too: | |
700 | mmh yes something to make better - therefore I would need the a Kleo::KeyListJob ? |
mimetreeparser/src/viewer/objecttreeparser.cpp | ||
---|---|---|
700 | If you want you can do this with a keylistjob. You can also use gpgme++ directly. But you then also need some pretty print code especially for S/MIME Recipients to handle the DN. Imo we really want a solution for this in Libkleo I want to have something like this in Kleopatra's dialogs, too. Probably moving Kleopatra/src/utils/formatting.cpp into libkleo and extending it to handle stuff like decryption error. Maybe Kdepim style by using grantlee templates that are filled with error information? So that we can have a generic solution for Key lookup, uid formatting etc. and still include special stuff like kmail:showCertificate links? |
mimetreeparser/src/viewer/objecttreeparser.cpp | ||
---|---|---|
700 | Please do not add grantlee as dependency for textoutput. For me libkleo should give me a object, with where it is easy to create nice dialogs. For kube we want to get rid of rendering everything to html for displaying and use native UI elements, that's why it is contraproductive to switch more things to grantlee/html if it is not needed. |