[git] GpgOL - branch, master, updated. gpgol-2.2.0-7-g630844d

by Andre Heinecke cvs at cvs.gnupg.org
Wed Jun 20 15:00:48 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  630844dc453ac59cbd73beb225548b40d7d1b239 (commit)
       via  027fca10518a088467be8b0507603d25c6c50a8e (commit)
      from  9f132ff7cbc2f2484ce234f7d4bb163bb743f703 (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 630844dc453ac59cbd73beb225548b40d7d1b239
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Jun 20 14:58:16 2018 +0200

    Handle always sign/encrypt for inline reply/fw
    
    * src/mailitem-events.cpp (reply, forward, replyall): Handle
    the always sign/encrypt options.
    
    --
    If the option reply_crypt is set and the reply is to
    a crypto mail the settings from that mail will override
    the always options.
    
    Previously this only worked in the Open command so only
    if a new message composer window was opened.
    
    This fixes a problem noticed in:
    GnuPG-Bug-Id: T4037

diff --git a/src/mailitem-events.cpp b/src/mailitem-events.cpp
index 4805f5f..b499966 100644
--- a/src/mailitem-events.cpp
+++ b/src/mailitem-events.cpp
@@ -734,11 +734,52 @@ EVENT_SINK_INVOKE(MailItemEvents)
         {
           log_oom_extra ("%s:%s: %s : %p",
                          SRCNAME, __func__, is_reply ? "reply" : "forward", m_mail);
-          if (!m_mail->is_crypto_mail ())
+          int draft_flags = 0;
+          if (opt.encrypt_default)
+            {
+              draft_flags = 1;
+            }
+          if (opt.sign_default)
             {
-              /* Non crypto mails do not interest us.*/
+              draft_flags += 2;
+            }
+          bool is_crypto_mail = m_mail->is_crypto_mail();
+
+          /* If it is a crypto mail and the settings should not be taken
+           * from the crypto mail and always encrypt / sign is on. Or
+           * If it is not a crypto mail and we have automaticalls sign_encrypt. */
+          if ((is_crypto_mail && !opt.reply_crypt && draft_flags) ||
+              (!is_crypto_mail && draft_flags))
+            {
+              /* Check if we can use the dispval */
+                if (parms->cArgs == 2 && parms->rgvarg[1].vt == (VT_DISPATCH) &&
+                    parms->rgvarg[0].vt == (VT_BOOL | VT_BYREF))
+                {
+                  LPMESSAGE msg = get_oom_base_message (parms->rgvarg[1].pdispVal);
+                  if (msg)
+                    {
+                      set_gpgol_draft_info_flags (msg, draft_flags);
+                      gpgol_release (msg);
+                    }
+                  else
+                    {
+                      log_error ("%s:%s: Failed to get base message.",
+                                 SRCNAME, __func__);
+                    }
+                }
+              else
+                {
+                  log_error ("%s:%s: Unexpected parameters.",
+                             SRCNAME, __func__);
+                }
+            }
+
+          if (!is_crypto_mail)
+            {
+              /* Replys to non crypto mails do not interest us anymore. */
               break;
             }
+
           Mail *last_mail = Mail::get_last_mail ();
           if (Mail::is_valid_ptr (last_mail))
             {

commit 027fca10518a088467be8b0507603d25c6c50a8e
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Jun 20 14:21:02 2018 +0200

    Add clarifying comment about forward reply detect
    
    --
    I just looked at it and at first could not remember why
    I didn't just use the pdispVal.

diff --git a/src/mailitem-events.cpp b/src/mailitem-events.cpp
index 9effeb1..4805f5f 100644
--- a/src/mailitem-events.cpp
+++ b/src/mailitem-events.cpp
@@ -745,6 +745,10 @@ EVENT_SINK_INVOKE(MailItemEvents)
               /* We want to identify here if there was a mail created that
                  should receive the contents of this mail. For this we check
                  for a forward in the same loop as a mail creation.
+
+                 We need to do it this complicated and can't just use
+                 get_mail_for_item because the mailitem pointer we get here
+                 is a different one then the one with which the mail was loaded.
               */
               char *lastEntryID = get_oom_string (last_mail->item (), "EntryID");
               int lastSize = get_oom_int (last_mail->item (), "Size");

-----------------------------------------------------------------------

Summary of changes:
 src/mailitem-events.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 47 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list