diff options
Diffstat (limited to 'framework/src/domain/composercontroller.cpp')
-rw-r--r-- | framework/src/domain/composercontroller.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/framework/src/domain/composercontroller.cpp b/framework/src/domain/composercontroller.cpp index 2286a71b..a71e66f9 100644 --- a/framework/src/domain/composercontroller.cpp +++ b/framework/src/domain/composercontroller.cpp | |||
@@ -135,7 +135,7 @@ public: | |||
135 | SinkLog() << "Searching key for: " << mb.address(); | 135 | SinkLog() << "Searching key for: " << mb.address(); |
136 | asyncRun<std::vector<GpgME::Key>>(this, | 136 | asyncRun<std::vector<GpgME::Key>>(this, |
137 | [mb] { | 137 | [mb] { |
138 | return MailCrypto::findKeys(QStringList{} << mb.address(), false, false, MailCrypto::OPENPGP); | 138 | return MailCrypto::findKeys(QStringList{} << mb.address(), false, false); |
139 | }, | 139 | }, |
140 | [this, addressee, id](const std::vector<GpgME::Key> &keys) { | 140 | [this, addressee, id](const std::vector<GpgME::Key> &keys) { |
141 | if (!keys.empty()) { | 141 | if (!keys.empty()) { |
@@ -463,18 +463,25 @@ KMime::Message::Ptr ComposerController::assembleMessage() | |||
463 | }; | 463 | }; |
464 | }); | 464 | }); |
465 | 465 | ||
466 | GpgME::Key attachedKey; | ||
466 | std::vector<GpgME::Key> signingKeys; | 467 | std::vector<GpgME::Key> signingKeys; |
467 | if (getSign()) { | 468 | if (getSign()) { |
468 | signingKeys = getPersonalKeys().value<std::vector<GpgME::Key>>(); | 469 | signingKeys = getPersonalKeys().value<std::vector<GpgME::Key>>(); |
470 | Q_ASSERT(!signingKeys.empty()); | ||
471 | attachedKey = signingKeys[0]; | ||
469 | } | 472 | } |
470 | std::vector<GpgME::Key> encryptionKeys; | 473 | std::vector<GpgME::Key> encryptionKeys; |
471 | if (getEncrypt()) { | 474 | if (getEncrypt()) { |
472 | //Encrypt to self so we can read the sent message | 475 | //Encrypt to self so we can read the sent message |
473 | encryptionKeys += getPersonalKeys().value<std::vector<GpgME::Key>>(); | 476 | auto personalKeys = getPersonalKeys().value<std::vector<GpgME::Key>>(); |
477 | |||
478 | attachedKey = personalKeys[0]; | ||
479 | |||
480 | encryptionKeys += personalKeys; | ||
474 | encryptionKeys += getRecipientKeys(); | 481 | encryptionKeys += getRecipientKeys(); |
475 | } | 482 | } |
476 | 483 | ||
477 | return MailTemplates::createMessage(mExistingMessage, toAddresses, ccAddresses, bccAddresses, getIdentity(), getSubject(), getBody(), getHtmlBody(), attachments, signingKeys, encryptionKeys); | 484 | return MailTemplates::createMessage(mExistingMessage, toAddresses, ccAddresses, bccAddresses, getIdentity(), getSubject(), getBody(), getHtmlBody(), attachments, signingKeys, encryptionKeys, attachedKey); |
478 | } | 485 | } |
479 | 486 | ||
480 | void ComposerController::send() | 487 | void ComposerController::send() |