Add patch for GpgOL
authorAndre Heinecke <aheinecke@intevation.de>
Fri, 8 Dec 2017 09:25:37 +0000 (10:25 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Fri, 8 Dec 2017 09:25:37 +0000 (10:25 +0100)
* patches/gpgol-2.0.5/0001-Fix-g-sync-account-warning.patch: New.

--
This fixes wrong warnings and their encoding

Makefile.am
patches/gpgol-2.0.5/0001-Fix-g-sync-account-warning.patch [new file with mode: 0755]

index 2e18138..526fc67 100644 (file)
@@ -52,7 +52,9 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/gpgex-1.0.4/0001-Prefer-kleowrapped-gpgwrapped-binaries.patch \
         patches/gpgex-1.0.4/0002-Fix-loop-logic-error-in-new-server-name-detection.patch \
         patches/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch \
-        patches/gpa-0.9.10/0001-w32-Make-location-of-locale-dir-more-flexible.patch
+        patches/gpa-0.9.10/0001-w32-Make-location-of-locale-dir-more-flexible.patch \
+        patches/gpgol-2.0.5/0001-Fix-g-sync-account-warning.patch
+
 
 copy-news:
        cp NEWS doc/website/NEWS.last
diff --git a/patches/gpgol-2.0.5/0001-Fix-g-sync-account-warning.patch b/patches/gpgol-2.0.5/0001-Fix-g-sync-account-warning.patch
new file mode 100755 (executable)
index 0000000..8082109
--- /dev/null
@@ -0,0 +1,109 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From c574893790b041dca19b8fe6fd45fe10b0b8b58e Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke@intevation.de>
+Date: Fri, 8 Dec 2017 10:21:35 +0100
+Subject: [PATCH] Fix g sync account warning
+
+* src/mail.cpp (Mail::encrypt_sign): Handle encoding
+(Mail::Mail): Initialize check correctly.
+---
+ src/mail.cpp | 47 +++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 33 insertions(+), 14 deletions(-)
+
+diff --git a/src/mail.cpp b/src/mail.cpp
+index dd58f6d..be7be31 100644
+--- a/src/mail.cpp
++++ b/src/mail.cpp
+@@ -130,7 +130,9 @@ Mail::Mail (LPDISPATCH mailitem) :
+     m_needs_encrypt(false),
+     m_moss_position(0),
+     m_crypto_flags(0),
+-    m_type(MSGTYPE_UNKNOWN)
++    m_type(MSGTYPE_UNKNOWN),
++    m_do_inline(false),
++    m_is_gsuite(false)
+ {
+   if (get_mail_for_item (mailitem))
+     {
+@@ -995,46 +997,63 @@ Mail::encrypt_sign ()
+       int n_att_usable = count_usable_attachments (att_table);
+       mapi_release_attach_table (att_table);
+       /* Check for attachments if we have some abort. */
++
++      wchar_t *w_title = utf8_to_wchar (_(
++                              "GpgOL: Oops, G Suite Sync account detected"));
+       if (n_att_usable)
+         {
+-          MessageBox (window,
++          wchar_t *msg = utf8_to_wchar (
+                       _("G Suite Sync breaks outgoing crypto mails "
+                         "with attachments.\nUsing crypto and attachments "
+                         "with G Suite Sync is not supported.\n\n"
+-                        "See: https://dev.gnupg.org/T3545 for details."),
+-                      _("GpgOL: Oops, G Suite Sync account detected"),
+-                      MB_ICONINFORMATION|MB_OK);
++                        "See: https://dev.gnupg.org/T3545 for details."));
++          MessageBoxW (window,
++                       msg,
++                       w_title,
++                       MB_ICONINFORMATION|MB_OK);
++          xfree (msg);
++          xfree (w_title);
+           return -1;
+         }
+       if (flags == 2)
+         {
+-          MessageBox (window,
+-                      _("G Suite Sync breaks outgoing signed mails.\n"
++          wchar_t *msg = utf8_to_wchar (
++                       _("G Suite Sync breaks outgoing signed mails.\n"
+                         "Ensuring mail integrity (signing) with G Suite Sync "
+                         "is not supported.\n\n"
+-                        "See: https://dev.gnupg.org/T3545 for details."),
+-                      _("GpgOL: Oops, G Suite Sync account detected"),
+-                      MB_ICONINFORMATION|MB_OK);
++                        "See: https://dev.gnupg.org/T3545 for details."));
++          MessageBoxW (window,
++                       msg,
++                       w_title,
++                       MB_ICONINFORMATION|MB_OK);
++          xfree (msg);
++          xfree (w_title);
+           return -1;
+         }
+       if (flags == 3)
+         {
+-          if(MessageBox (window,
++          wchar_t *msg = utf8_to_wchar (
+                         _("G Suite Sync breaks outgoing signed mails.\n"
+                           "Ensuring mail integrity (signing) with G Suite Sync "
+                           "is not supported.\n\n"
+                           "See: https://dev.gnupg.org/T3545 for details.\n\n"
+-                          "Do you want to only encrypt the message?"),
+-                        _("GpgOL: Oops, G Suite Sync account detected"),
+-                        MB_ICONINFORMATION|MB_YESNO) != IDYES)
++                          "Do you want to only encrypt the message?"));
++          if(MessageBoxW (window,
++                          msg,
++                          w_title,
++                          MB_ICONINFORMATION|MB_YESNO) != IDYES)
+             {
++              xfree (msg);
++              xfree (w_title);
+               return -1;
+             }
+           else
+             {
+               flags = 1;
+             }
++          xfree (msg);
+         }
++      xfree (w_title);
+     }
+
+   m_do_inline = m_is_gsuite ? true : opt.inline_pgp;
+--
+2.11.0