diff options
Diffstat (limited to 'framework/src/domain/composercontroller.cpp')
-rw-r--r-- | framework/src/domain/composercontroller.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/framework/src/domain/composercontroller.cpp b/framework/src/domain/composercontroller.cpp index 2286a71b..37902164 100644 --- a/framework/src/domain/composercontroller.cpp +++ b/framework/src/domain/composercontroller.cpp | |||
@@ -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() |