[git] GpgOL - branch, master, updated. gpgol-1.2.0-83-g4524779

by Andre Heinecke cvs at cvs.gnupg.org
Mon Nov 2 17:25:58 CET 2015


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  452477949fe2f1d8ca36ebbad31c6f3c6607e30e (commit)
       via  9ea4f4f9993d6cf87c20d75e6de9b65783f268ac (commit)
      from  7294034592b5bef76dc06be5242e13bf6e39922f (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 452477949fe2f1d8ca36ebbad31c6f3c6607e30e
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Nov 2 17:24:15 2015 +0100

    Save mailitem on close
    
    * src/mail.h (Mail::is_crypto_mail): New.
    * src/mailitem-events.cpp (EVENT_SINK_INVOKE): Call Save on
      Close.
    --
    This prevents the "The properties of the message have changed"
    Dialog but has the side effect that the plain text has to be removed
    from the mail as the Save will trigger a Write event.

diff --git a/src/mail.h b/src/mail.h
index fc9ca21..81547cd 100644
--- a/src/mail.h
+++ b/src/mail.h
@@ -114,6 +114,15 @@ public:
    * @returns A reference to the utf8 sender address. Or NULL. */
   const char *get_sender ();
 
+  /** @brief Is this a crypto mail handled by gpgol.
+  *
+  * Calling this is only valid after a message has been processed.
+  *
+  * @returns true if the mail was either signed or encrypted and we processed
+  * it.
+  */
+  bool is_crypto_mail () { return m_processed; }
+
 private:
   LPDISPATCH m_mailitem;
   LPDISPATCH m_event_sink;
diff --git a/src/mailitem-events.cpp b/src/mailitem-events.cpp
index 910eabf..5608356 100644
--- a/src/mailitem-events.cpp
+++ b/src/mailitem-events.cpp
@@ -228,6 +228,13 @@ EVENT_SINK_INVOKE(MailItemEvents)
             }
           break;
         }
+      case Close:
+        {
+          if (m_mail->is_crypto_mail ())
+            {
+              invoke_oom_method (m_object, "Save", NULL);
+            }
+        }
       case Unload:
         {
           log_debug ("%s:%s: Removing Mail for message: %p.",

commit 9ea4f4f9993d6cf87c20d75e6de9b65783f268ac
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Nov 2 17:22:14 2015 +0100

    Add more debug output for msg wipes.
    
    * src/mail.cpp (Mail::insert_plaintext): Check if msg already
      needs wipe and log it. Log plaintext with msg ptr.
      (Mail::wipe): Log wipe error.

diff --git a/src/mail.cpp b/src/mail.cpp
index baf0cb5..c5ea30a 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -161,6 +161,13 @@ Mail::insert_plaintext ()
       return 0;
     }
 
+  if (m_needs_wipe)
+    {
+      log_error ("%s:%s: Insert plaintext called for msg that needs wipe: %p",
+                 SRCNAME, __func__, m_mailitem);
+      return 0;
+    }
+
   /* Outlook somehow is confused about the attachment
      table of our sent mails. The securemessage interface
      gives us access to the real attach table but the attachment
@@ -175,6 +182,9 @@ Mail::insert_plaintext ()
   err = mapi_get_gpgol_body_attachment (base_message, &body, NULL,
                                         &is_html, &was_protected);
   m_needs_wipe = was_protected;
+
+  log_debug ("%s:%s: Setting plaintext for msg: %p",
+             SRCNAME, __func__, m_mailitem);
   if (err || !body)
     {
       log_error ("%s:%s: Failed to get body attachment. Err: %i",
@@ -285,6 +295,8 @@ Mail::wipe ()
                       HTML_TEMPLATE) ||
       protect_attachments (m_mailitem))
     {
+      log_debug ("%s:%s: Failed to wipe mailitem: %p.",
+                 SRCNAME, __func__, m_mailitem);
       return -1;
     }
   m_needs_wipe = false;

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

Summary of changes:
 src/mail.cpp            | 12 ++++++++++++
 src/mail.h              |  9 +++++++++
 src/mailitem-events.cpp |  7 +++++++
 3 files changed, 28 insertions(+)


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




More information about the Gnupg-commits mailing list