<table><tr><td style="">dvratil created this revision.<br />dvratil added reviewers: aheinecke, bjoernbalazs.<br />dvratil added a subscriber: KDE PIM.<br />dvratil set the repository for this revision to rKDEPIMADDONS KDE PIM Addons.<br />dvratil added a project: KDE PIM.<br />Restricted Application added a subscriber: kde-pim.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D3140" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This adds a new body part formatter plugin for application/pgp-keys mime type and application/vnd.gnupg.wks mimetype.</p>

<p>The application/pgp-keys formatter simply prints a message saying that this is an OpenPGP key and explains what that is, as seen below:<br />
<a href="https://phabricator.kde.org/F377010" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F377010: pgp-1.png</a></p>

<p>User can click the "Show key details" link to get details about the key (uid, creation date, fingerprint), and if the key is available in local keyring there will also be "Open in Kleopatra" link.<br />
<a href="https://phabricator.kde.org/F377011" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F377011: pgp-2.png</a></p>

<p>The application/vnd.gnupg.wks mimetype formatter is more complicated. It handles WKS publication confirmation requests. The formatter prints a message saying that this is a Key publication confirmation request and explains what it is. It shows a button in the middle saying "Checking key state..." and checks the WKD for the key. If the key is found, it says that the key has been published and allows no further interaction.<br />
<a href="https://phabricator.kde.org/F377012" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F377012: wks-3.png</a></p>

<p>If it does not find the key in the WKD, it show "Publish key" button.<br />
<a href="https://phabricator.kde.org/F377013" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F377013: wks-1.png</a></p>

<p>When clicked, it will create the confirmation response and send it to the WKD server and update the view again. It uses SmtpJob, so there's no email left behind in "Sent" folder.<br />
<a href="https://phabricator.kde.org/F377014" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;" rel="noreferrer">F377014: wks-2.png</a></p>

<p>After the response is successfully sent we go an extra mile and we store the state in an Akonadi::Attribute in the respective Akonadi::Item for the message. We then check for the presence of this attribute in case the user would open the email again before the server manages to process the confirmation response and publish the key, which would result in KMail again showing the "Publish key" button (despite response already being sent). Instead when the attribute is present we show the "Key already published" message.</p>

<p>I would appreciate your feedback mostly regarding the user-facing strings, which can all be found in the .html files.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Tested with locally generated messages. Have not tested actually sending out the response.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>rKDEPIMADDONS KDE PIM Addons</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D3140" rel="noreferrer">https://phabricator.kde.org/D3140</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/messageviewer/bodypartformatter/CMakeLists.txt<br />
plugins/messageviewer/bodypartformatter/gnupgwks/CMakeLists.txt<br />
plugins/messageviewer/bodypartformatter/gnupgwks/application_gnupgwks.desktop<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksakonadi.cpp<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksakonadi.h<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.h<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmemento.cpp<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmemento.h<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.cpp<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksmessagepart.h<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.cpp<br />
plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h<br />
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.cpp<br />
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyformatter.h<br />
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymemento.cpp<br />
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymemento.h<br />
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.cpp<br />
plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeymessagepart.h<br />
plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp<br />
plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h<br />
plugins/messageviewer/bodypartformatter/gnupgwks/templates.qrc<br />
plugins/messageviewer/bodypartformatter/gnupgwks/templates/gnupgwksmessagepart.html<br />
plugins/messageviewer/bodypartformatter/gnupgwks/templates/pgpkeymessagepart.html</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>dvratil, aheinecke, bjoernbalazs<br /><strong>Cc: </strong>kde-pim, KDE PIM, spencerb, dvasin, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>