diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-03-02 15:40:32 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-03-02 15:40:32 +0100 |
commit | 330fe2ce9372bace91ac03ae1b5401027509242a (patch) | |
tree | 15d1d65d6f52ae3cacda45bef524485f76cea3d7 /framework/src/domain/composercontroller.cpp | |
parent | 8c7e8cb8ebd7f42afde73cb6e41bb3b6bac1b942 (diff) | |
download | kube-330fe2ce9372bace91ac03ae1b5401027509242a.tar.gz kube-330fe2ce9372bace91ac03ae1b5401027509242a.zip |
Revert "Support encrypted mails forwarding"
This reverts commit f28ec43dca5b2915deb69d54fb942ddf1303f48c.
That was pushed by accident.
Diffstat (limited to 'framework/src/domain/composercontroller.cpp')
-rw-r--r-- | framework/src/domain/composercontroller.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/framework/src/domain/composercontroller.cpp b/framework/src/domain/composercontroller.cpp index 2286a71b..09d4c154 100644 --- a/framework/src/domain/composercontroller.cpp +++ b/framework/src/domain/composercontroller.cpp | |||
@@ -99,19 +99,19 @@ class AddresseeController : public Kube::ListPropertyController | |||
99 | public: | 99 | public: |
100 | 100 | ||
101 | bool mFoundAllKeys = true; | 101 | bool mFoundAllKeys = true; |
102 | |||
103 | QSet<QByteArray> mMissingKeys; | 102 | QSet<QByteArray> mMissingKeys; |
104 | AddresseeController() : Kube::ListPropertyController{{"name", "keyFound", "key"}} | 103 | AddresseeController() |
104 | : Kube::ListPropertyController{{"name", "keyFound", "key"}} | ||
105 | { | 105 | { |
106 | QObject::connect( | 106 | QObject::connect(this, &Kube::ListPropertyController::added, this, [this] (const QByteArray &id, const QVariantMap &map) { |
107 | this, &Kube::ListPropertyController::added, this, [this](const QByteArray &id, const QVariantMap &map) { | 107 | findKey(id, map.value("name").toString()); |
108 | findKey(id, map.value("name").toString()); | 108 | }); |
109 | }); | ||
110 | |||
111 | QObject::connect(this, &Kube::ListPropertyController::removed, this, [this] (const QByteArray &id) { | 109 | QObject::connect(this, &Kube::ListPropertyController::removed, this, [this] (const QByteArray &id) { |
112 | mMissingKeys.remove(id); | 110 | mMissingKeys.remove(id); |
113 | setFoundAllKeys(mMissingKeys.isEmpty()); | 111 | setFoundAllKeys(mMissingKeys.isEmpty()); |
114 | }); | 112 | }); |
113 | |||
114 | |||
115 | } | 115 | } |
116 | 116 | ||
117 | bool foundAllKeys() | 117 | bool foundAllKeys() |
@@ -133,13 +133,12 @@ public: | |||
133 | mb.fromUnicodeString(addressee); | 133 | mb.fromUnicodeString(addressee); |
134 | 134 | ||
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, [mb] { |
137 | [mb] { | ||
138 | return MailCrypto::findKeys(QStringList{} << mb.address(), false, false, MailCrypto::OPENPGP); | 137 | return MailCrypto::findKeys(QStringList{} << mb.address(), false, false, MailCrypto::OPENPGP); |
139 | }, | 138 | }, |
140 | [this, addressee, id](const std::vector<GpgME::Key> &keys) { | 139 | [this, addressee, id](const std::vector<GpgME::Key> &keys) { |
141 | if (!keys.empty()) { | 140 | if (!keys.empty()) { |
142 | if (keys.size() > 1) { | 141 | if (keys.size() > 1 ) { |
143 | SinkWarning() << "Found more than one key, encrypting to all of them."; | 142 | SinkWarning() << "Found more than one key, encrypting to all of them."; |
144 | } | 143 | } |
145 | SinkLog() << "Found key: " << keys.front().primaryFingerprint(); | 144 | SinkLog() << "Found key: " << keys.front().primaryFingerprint(); |
@@ -155,7 +154,7 @@ public: | |||
155 | 154 | ||
156 | void set(const QStringList &list) | 155 | void set(const QStringList &list) |
157 | { | 156 | { |
158 | for (const auto &email : list) { | 157 | for (const auto &email: list) { |
159 | add({{"name", email}}); | 158 | add({{"name", email}}); |
160 | } | 159 | } |
161 | } | 160 | } |