[git] GpgOL - branch, master, updated. gpgol-2.2.0-11-g4213ac0
by Andre Heinecke
cvs at cvs.gnupg.org
Thu Jun 21 13:13:54 CEST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".
The branch, master has been updated
via 4213ac0986d7058307a733d4a853a9b790a9c971 (commit)
via 3774434014b9fbb4d7d1b705941b2827d7b2fb65 (commit)
via 60b331568188a774cb519e2df752baf4c1e9a5d3 (commit)
from c8f46557da704d863052709d5b627970450a0d1d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4213ac0986d7058307a733d4a853a9b790a9c971
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Thu Jun 21 13:11:11 2018 +0200
Set UUID when auto toggling secure
* src/mail.cpp (Mail::set_do_autosecure_mapi): set uuid.
--
Setting the UUID is neccessary to find the Mail object from
the toggle button to mark that the state was manually set.
GnuPG-Bug-Id: T3999
diff --git a/src/mail.cpp b/src/mail.cpp
index fb835d8..f2be77c 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -3275,6 +3275,10 @@ Mail::set_do_autosecure_mapi(bool value)
{
TRACEPOINT;
}
+ /* We need to set a uuid so that autosecure can
+ be disabled manually */
+ set_uuid ();
+
int old_flags = get_gpgol_draft_info_flags (msg);
if (old_flags && m_first_autosecure_check)
{
commit 3774434014b9fbb4d7d1b705941b2827d7b2fb65
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Thu Jun 21 13:10:40 2018 +0200
Fix flicker when locate threads are running
* src/mail.cpp (Mail::autoresolve_s): Check locate thread count.
--
GnuPG-Bug-Id: T3999
diff --git a/src/mail.cpp b/src/mail.cpp
index 274f121..fb835d8 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -3246,7 +3246,8 @@ Mail::decrement_locate_count()
void
Mail::autoresolve_check_s()
{
- if (!opt.autoresolve || m_manual_crypto_opts)
+ if (!opt.autoresolve || m_manual_crypto_opts ||
+ m_locate_count)
{
return;
}
commit 60b331568188a774cb519e2df752baf4c1e9a5d3
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Thu Jun 21 11:22:47 2018 +0200
Simplify isMailResolvable and accept keygen
* src/keycache.cpp (isMailResolvable): Return bool. Accept
potential keygen.
* src/keycache.h: Update accordingly.
* src/mail.cpp (Mail::autoresolve_check_s): Update for new API.
--
This inly check for a self key for SMIME. For OpenPGP we can
generate a key.
GnuPG-Bug-Id: T3999
diff --git a/src/keycache.cpp b/src/keycache.cpp
index 742046f..75d971b 100644
--- a/src/keycache.cpp
+++ b/src/keycache.cpp
@@ -621,7 +621,7 @@ KeyCache::setPgpKeySecret(const std::string &mbox, const GpgME::Key &key)
d->setPgpKeySecret(mbox, key);
}
-int
+bool
KeyCache::isMailResolvable(Mail *mail)
{
/* Get the data from the mail. */
@@ -632,44 +632,28 @@ KeyCache::isMailResolvable(Mail *mail)
{
log_debug ("%s:%s: Mail has no sender or no recipients.",
SRCNAME, __func__);
- return 0;
+ return false;
}
- /* Include sender for encryption */
- recps.push_back (sender);
- GpgME::Key sigKey = getSigningKey (sender.c_str(), GpgME::OpenPGP);
std::vector<GpgME::Key> encKeys = getEncryptionKeys (recps,
GpgME::OpenPGP);
- int pgpState = 0;
if (!encKeys.empty())
{
- pgpState = 1;
- }
- if (!sigKey.isNull())
- {
- pgpState += 2;
+ return true;
}
- if (pgpState == 3 /* all good */ || !opt.enable_smime)
+ if (!opt.enable_smime)
{
- return pgpState;
+ return false;
}
- /* Check S/MIME instead */
- sigKey = getSigningKey (sender.c_str(), GpgME::CMS);
+ /* Check S/MIME instead here we need to include the sender
+ as we can't just generate a key. */
+ recps.push_back (sender);
+ GpgME::Key sigKey= getSigningKey (sender.c_str(), GpgME::CMS);
encKeys = getEncryptionKeys (recps, GpgME::CMS);
- int cmsState = 0;
- if (!encKeys.empty())
- {
- cmsState = 1;
- }
- if (!sigKey.isNull())
- {
- cmsState += 2;
- }
-
- return (cmsState > pgpState) ? cmsState : pgpState;
+ return !encKeys.empty() && !sigKey.isNull();
}
diff --git a/src/keycache.h b/src/keycache.h
index 7c4b4be..9cdf499 100644
--- a/src/keycache.h
+++ b/src/keycache.h
@@ -75,9 +75,10 @@ public:
/* Check that a mail is resolvable through the keycache.
*
- * Returns the usual int with sign = 2 and encrypt = 1
+ * For OpenPGP only the recipients are checked as we can
+ * generate a new key for the sender.
**/
- int isMailResolvable (Mail *mail);
+ bool isMailResolvable (Mail *mail);
// Internal for thread
void setSmimeKey(const std::string &mbox, const GpgME::Key &key);
diff --git a/src/mail.cpp b/src/mail.cpp
index f02f127..274f121 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -3250,7 +3250,7 @@ Mail::autoresolve_check_s()
{
return;
}
- int ret = KeyCache::instance()->isMailResolvable (this);
+ bool ret = KeyCache::instance()->isMailResolvable (this);
log_debug ("%s:%s: status %i",
SRCNAME, __func__, ret);
@@ -3259,14 +3259,8 @@ Mail::autoresolve_check_s()
* to be triggered by the locator threads finishing we
* need to actually set the draft info flags in
* the ui thread. */
- if (ret == 3)
- {
- do_in_ui_thread (DO_AUTO_SECURE, this);
- }
- else
- {
- do_in_ui_thread (DONT_AUTO_SECURE, this);
- }
+ do_in_ui_thread (ret ? DO_AUTO_SECURE : DONT_AUTO_SECURE,
+ this);
return;
}
-----------------------------------------------------------------------
Summary of changes:
src/keycache.cpp | 36 ++++++++++--------------------------
src/keycache.h | 5 +++--
src/mail.cpp | 19 +++++++++----------
3 files changed, 22 insertions(+), 38 deletions(-)
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list