[git] GpgOL - branch, mime-addin, updated. gpgol-1.2.0-40-g8afa4a3

by Andre Heinecke cvs at cvs.gnupg.org
Fri Oct 2 14:40:55 CEST 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, mime-addin has been updated
       via  8afa4a3780c8e6da5ea9549b48b7369a41851164 (commit)
       via  033570ca70fda9939106868a739f016f379806e2 (commit)
       via  9196bff24b3176d8d2db38f4a3c15e71cf0cad3a (commit)
       via  ac08e521e553b9a49d32fd55c6b15718e145bffd (commit)
      from  9036bb3fe96742b6e4f46581d86ca8bf59c6a9a5 (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 8afa4a3780c8e6da5ea9549b48b7369a41851164
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Oct 2 14:32:28 2015 +0200

    Remove mailitem event handler on unload
    
    * src/mailitem-events.cpp (invoke): Handle unload.
    
    --
    Thought this might fix a crash but it did not. Anyway
    removing the event handler on unload and deleting it
    is the right thing to do to avoid leaking it and a
    ref to an unloaded mailitem.

diff --git a/src/mailitem-events.cpp b/src/mailitem-events.cpp
index e1d024b..dab2c99 100644
--- a/src/mailitem-events.cpp
+++ b/src/mailitem-events.cpp
@@ -359,6 +359,16 @@ EVENT_SINK_INVOKE(MailItemEvents)
             }
           break;
         }
+      case Unload:
+        {
+          log_debug ("%s:%s: Unloading event handler for msg: %p.",
+                     SRCNAME, __func__, m_object);
+          detach_MailItemEvents_sink (this);
+          delete this;
+          log_debug ("%s:%s: Unloaded.",
+                     SRCNAME, __func__);
+          return S_OK;
+        }
       default:
         log_oom_extra ("%s:%s: Message:%p Unhandled Event: %lx \n",
                        SRCNAME, __func__, m_object, dispid);

commit 033570ca70fda9939106868a739f016f379806e2
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Oct 2 14:29:02 2015 +0200

    Hopefully fix Ol 2016 crash on send
    
    * src/mailitem-events.cpp (request_send): Remove delay.
    
    --
    Earlier tests with 2013 made me think that the delay was necessary
    here. But Ol 2016 and Ol 2013 work reliably without it.
    This makes the code more deterministic (Placing a Window message
    in the Queue right after the encryption is done.) and appears
    to fix a random crash in Ol 2016 where Outlook Itself would crash
    after sending the message.

diff --git a/src/mailitem-events.cpp b/src/mailitem-events.cpp
index 492e2db..e1d024b 100644
--- a/src/mailitem-events.cpp
+++ b/src/mailitem-events.cpp
@@ -17,6 +17,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "config.h"
 #include "common.h"
 #include "eventsink.h"
 #include "eventsinks.h"
@@ -211,23 +212,15 @@ do_crypto_on_item (LPDISPATCH mailitem)
 DWORD WINAPI
 request_send (LPVOID arg)
 {
-  int not_sent = 1;
-  int tries = 0;
-  do
+  log_debug ("%s:%s: requesting send for: %p",
+             SRCNAME, __func__, arg);
+  if (do_in_ui_thread (REQUEST_SEND_MAIL, arg))
     {
-      /* Outlook needs to handle the message some more to unblock
-         calls to Send. Lets give it 50ms before we send it again. */
-      Sleep (50);
-      log_debug ("%s:%s: requesting send for: %p",
-                 SRCNAME, __func__, arg);
-      not_sent = do_in_ui_thread (REQUEST_SEND_MAIL, arg);
-      tries++;
-    } while (not_sent && tries < 50);
-  if (tries == 50)
-    {
-      // Hum should not happen but I rather avoid
-      // an endless loop in that case.
-      // TODO show error message.
+      MessageBox (NULL,
+                  "Error while requesting send of message.\n"
+                  "Please press the send button again.",
+                  _("GpgOL"),
+                  MB_ICONINFORMATION|MB_OK);
     }
   return 0;
 }

commit 9196bff24b3176d8d2db38f4a3c15e71cf0cad3a
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Oct 2 14:26:07 2015 +0200

    Fix return value of invoke_oom_method
    
    * src/oomhelp.cpp (invoke_oom_method): Return false on success.
    
    --
    This is the opposite of Qt style I'm used to that returns false on
    error so I'm confusing myself sometimes. But usually gpgol
    int return values return zero on success.

diff --git a/src/oomhelp.cpp b/src/oomhelp.cpp
index a920b51..ad50ec9 100644
--- a/src/oomhelp.cpp
+++ b/src/oomhelp.cpp
@@ -1088,9 +1088,9 @@ invoke_oom_method (LPDISPATCH pDisp, const char *name, VARIANT *rVariant)
           log_debug ("%s:%s: Method '%s' invokation failed: %#lx",
                      SRCNAME, __func__, name, hr);
           dump_excepinfo (execpinfo);
-          return false;
+          return -1;
         }
     }
 
-  return true;
+  return 0;
 }

commit ac08e521e553b9a49d32fd55c6b15718e145bffd
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Oct 2 14:24:20 2015 +0200

    Fix return value of mark_mime_action
    
    * src/ribbon-callbacks.cpp (mark_mime_action): Return S_OK when ok.
    
    --
    Weirdly enough Outlook 2016 does not care about the return value
    but versions < 2016 show an error.

diff --git a/src/ribbon-callbacks.cpp b/src/ribbon-callbacks.cpp
index cd5c4c8..ade0330 100644
--- a/src/ribbon-callbacks.cpp
+++ b/src/ribbon-callbacks.cpp
@@ -1306,6 +1306,8 @@ mark_mime_action (LPDISPATCH ctrl, int flags)
 
   message_flag_status (cur_window, newflags);
 
+  rc = S_OK;
+
 done:
   RELDISP (context);
   RELDISP (mailitem);

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

Summary of changes:
 src/mailitem-events.cpp  | 35 +++++++++++++++++++----------------
 src/oomhelp.cpp          |  4 ++--
 src/ribbon-callbacks.cpp |  2 ++
 3 files changed, 23 insertions(+), 18 deletions(-)


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




More information about the Gnupg-commits mailing list