diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-11-24 13:43:00 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-11-24 13:43:00 +0100 |
commit | f39da702c61685dc9b2437c533f74a3eed04a3e2 (patch) | |
tree | aa6b867c0a6d97f37ca586d2ff3d7a8e3ee9937c /framework | |
parent | da2b01c11aa79a53a6d099d1903b14ccb81d64be (diff) | |
download | kube-f39da702c61685dc9b2437c533f74a3eed04a3e2.tar.gz kube-f39da702c61685dc9b2437c533f74a3eed04a3e2.zip |
Ensure we have valid keys before sending
Diffstat (limited to 'framework')
-rw-r--r-- | framework/src/domain/composercontroller.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/framework/src/domain/composercontroller.cpp b/framework/src/domain/composercontroller.cpp index 630f9e10..375d2086 100644 --- a/framework/src/domain/composercontroller.cpp +++ b/framework/src/domain/composercontroller.cpp | |||
@@ -218,6 +218,7 @@ void ComposerController::findPersonalKey() | |||
218 | auto identity = getIdentity(); | 218 | auto identity = getIdentity(); |
219 | SinkLog() << "Looking for personal key for: " << identity.address(); | 219 | SinkLog() << "Looking for personal key for: " << identity.address(); |
220 | mPersonalKeys = MailCrypto::findKeys(QStringList{} << identity.address(), true); | 220 | mPersonalKeys = MailCrypto::findKeys(QStringList{} << identity.address(), true); |
221 | updateSendAction(); | ||
221 | } | 222 | } |
222 | 223 | ||
223 | void ComposerController::clear() | 224 | void ComposerController::clear() |
@@ -537,6 +538,17 @@ KMime::Message::Ptr ComposerController::assembleMessage() | |||
537 | void ComposerController::updateSendAction() | 538 | void ComposerController::updateSendAction() |
538 | { | 539 | { |
539 | auto enabled = !mToModel->stringList().isEmpty() && !getSubject().isEmpty() && !getAccountId().isEmpty(); | 540 | auto enabled = !mToModel->stringList().isEmpty() && !getSubject().isEmpty() && !getAccountId().isEmpty(); |
541 | if (getEncrypt()) { | ||
542 | if (!mToModel->foundAllKeys() || !mCcModel->foundAllKeys() || !mBccModel->foundAllKeys()) { | ||
543 | SinkWarning() << "Don't have all keys"; | ||
544 | enabled = false; | ||
545 | } | ||
546 | } | ||
547 | if (getSign()) { | ||
548 | if (mPersonalKeys.empty()) { | ||
549 | enabled = false; | ||
550 | } | ||
551 | } | ||
540 | sendAction()->setEnabled(enabled); | 552 | sendAction()->setEnabled(enabled); |
541 | } | 553 | } |
542 | 554 | ||