[svn] GpgOL - r254 - in trunk: . po src
svn author wk
cvs at cvs.gnupg.org
Wed May 28 16:08:05 CEST 2008
Author: wk
Date: 2008-05-28 16:08:03 +0200 (Wed, 28 May 2008)
New Revision: 254
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/configure.ac
trunk/po/de.po
trunk/po/sv.po
trunk/src/ChangeLog
trunk/src/common.h
trunk/src/dialogs.h
trunk/src/dialogs.rc
trunk/src/engine.c
trunk/src/main.c
trunk/src/mapihelp.cpp
trunk/src/mapihelp.h
trunk/src/mimeparser.c
trunk/src/olflange-dlgs.cpp
Log:
Add otpion to show encrypted messages as an attachment.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/ChangeLog 2008-05-28 14:08:03 UTC (rev 254)
@@ -1,3 +1,7 @@
+2008-05-28 Werner Koch <wk at g10code.com>
+
+ * Release 0.10.14.
+
2008-05-06 Werner Koch <wk at g10code.com>
* Release 0.10.13.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/ChangeLog 2008-05-28 14:08:03 UTC (rev 254)
@@ -1,3 +1,16 @@
+2008-05-28 Werner Koch <wk at g10code.com>
+
+ * dialogs.h (IDC_BODY_AS_ATTACHMENT): New.
+ * dialogs.rc: Add body-as-attachemnt checkbox to the otpion
+ dialog.
+ * olflange-dlgs.cpp (set_labels, GPGOptionsDlgProc): Add it.
+ * main.c (write_options, read_options): Handle bodyAsAttachment
+ registry key.
+ * mimeparser.c (start_attachment): Do not set the hidden flag if
+ the new option is used.
+ * mapihelp.cpp (mapi_test_attach_hidden): New.
+ (mapi_get_gpgol_body_attachment): Make use of that flag.
+
2008-05-23 Werner Koch <wk at g10code.com>
* mimemaker.c (struct sink_s): Add field ENC_COUNTER.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/NEWS 2008-05-28 14:08:03 UTC (rev 254)
@@ -1,3 +1,11 @@
+Noteworthy changes for version 0.10.15
+===================================================
+
+ * New option to present the body of a message as an attachment. This
+ is useful to make sure that the body will never show up in
+ plaintext in the message store.
+
+
Noteworthy changes for version 0.10.14 (2008-05-28)
===================================================
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/configure.ac 2008-05-28 14:08:03 UTC (rev 254)
@@ -16,8 +16,8 @@
# Remember to change the version number immediately *after* a release.
# Set my_issvn to "yes" for non-released code. Remember to run an
# "svn up" and "autogen.sh" right before creating a distribution.
-m4_define([my_version], [0.10.14])
-m4_define([my_issvn], [no])
+m4_define([my_version], [0.10.15])
+m4_define([my_issvn], [yes])
m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
|| echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')]))
Modified: trunk/po/de.po [not shown]
Modified: trunk/po/sv.po [not shown]
Modified: trunk/src/common.h
===================================================================
--- trunk/src/common.h 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/common.h 2008-05-28 14:08:03 UTC (rev 254)
@@ -118,6 +118,7 @@
int enable_default_key; /* Enable the use of DEFAULT_KEY. */
int preview_decrypt; /* Decrypt in preview window. */
int prefer_html; /* Prefer html in html/text alternatives. */
+ int body_as_attachment; /* Present encrypted message as attachment. */
/* The compatibility flags. */
struct
Modified: trunk/src/dialogs.h
===================================================================
--- trunk/src/dialogs.h 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/dialogs.h 2008-05-28 14:08:03 UTC (rev 254)
@@ -39,6 +39,7 @@
#define IDC_G_GENERAL 4023
#define IDC_G_SEND 4024
#define IDC_G_RECV 4025
+#define IDC_BODY_AS_ATTACHMENT 4026
/* Ids for the extended options dialog. */
Modified: trunk/src/dialogs.rc
===================================================================
--- trunk/src/dialogs.rc 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/dialogs.rc 2008-05-28 14:08:03 UTC (rev 254)
@@ -72,7 +72,7 @@
/* Receive options box. */
GROUPBOX "recv-options", IDC_G_RECV,
- 9, 104, 250, 36
+ 9, 104, 250, 47
CONTROL "preview-decrypt", IDC_PREVIEW_DECRYPT,
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
@@ -82,6 +82,10 @@
"Button", BS_AUTOCHECKBOX | WS_TABSTOP,
24, 125, 215, 10
+ CONTROL "body-as-attachment", IDC_BODY_AS_ATTACHMENT,
+ "Button", BS_AUTOCHECKBOX | WS_TABSTOP,
+ 24, 136, 215, 10
+
/* Stuff below the group boxes. */
LTEXT "GpgOL by g10 Code GmbH", IDC_STATIC,
8, 197, 100, 8
Modified: trunk/src/engine.c
===================================================================
--- trunk/src/engine.c 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/engine.c 2008-05-28 14:08:03 UTC (rev 254)
@@ -486,7 +486,8 @@
any = 1;
}
if (!PulseEvent (filter->out.condvar))
- log_error_w32 (-1, "%s:%s: PulseEvent(out) failed", SRCNAME, __func__);
+ log_error_w32 (-1, "%s:%s: PulseEvent(%p)[out] failed",
+ SRCNAME, __func__, filter->out.condvar);
release_out_lock (filter, __func__);
if (any)
@@ -533,7 +534,8 @@
break; /* the loop. */
}
if (!PulseEvent (filter->in.condvar))
- log_error_w32 (-1, "%s:%s: PulseEvent(in) failed", SRCNAME, __func__);
+ log_error_w32 (-1, "%s:%s: PulseEvent(%p)[in] failed",
+ SRCNAME, __func__, filter->in.condvar);
release_in_lock (filter, __func__);
if (any)
clear_switch_threads (filter);
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/main.c 2008-05-28 14:08:03 UTC (rev 254)
@@ -633,6 +633,10 @@
opt.svn_revision = val? atol (val) : 0;
xfree (val); val = NULL;
+ load_extension_value ("bodyAsAttachment", &val);
+ opt.body_as_attachment = val == NULL || *val != '1'? 0 : 1;
+ xfree (val); val = NULL;
+
/* Note, that on purpose these flags are only Registry changeable.
The format of the entry is a string of of "0" and "1" digits; see
the switch below for a description. */
@@ -706,6 +710,7 @@
{"enableDefaultKey", 0, opt.enable_default_key},
{"preferHtml", 0, opt.prefer_html},
{"svnRevision", 1, opt.svn_revision},
+ {"bodyAsAttachment", 0, opt.body_as_attachment},
{NULL, 0}
};
char buf[32];
Modified: trunk/src/mapihelp.cpp
===================================================================
--- trunk/src/mapihelp.cpp 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/mapihelp.cpp 2008-05-28 14:08:03 UTC (rev 254)
@@ -1685,7 +1685,7 @@
/* Mark this attachment as the orginal MOSS message. We set a custom
- property as well as the hidden hidden flag. */
+ property as well as the hidden flag. */
int
mapi_mark_moss_attach (LPMESSAGE message, mapi_attach_item_t *item)
{
@@ -1791,7 +1791,28 @@
}
+/* Returns true if ATTACH has the hidden flag set to true. */
+int
+mapi_test_attach_hidden (LPATTACH attach)
+{
+ HRESULT hr;
+ LPSPropValue propval = NULL;
+ int result = 0;
+
+ hr = HrGetOneProp ((LPMAPIPROP)attach, PR_ATTACHMENT_HIDDEN, &propval);
+ if (FAILED (hr))
+ return result; /* No. */
+
+ if (PROP_TYPE (propval->ulPropTag) == PT_BOOLEAN && propval->Value.b)
+ result = 1; /* Yes. */
+ MAPIFreeBuffer (propval);
+ return result;
+}
+
+
+
+
/* Returns True if MESSAGE has the GpgOL Sig Status property. */
int
mapi_has_sig_status (LPMESSAGE msg)
@@ -2333,8 +2354,21 @@
&& get_gpgolattachtype (att, moss_tag) == ATTACHTYPE_FROMMOSS)
{
found = 1;
- if (r_body)
+ if (!r_body)
+ ; /* Body content has not been requested. */
+ else if (opt.body_as_attachment && !mapi_test_attach_hidden (att))
{
+ /* The body is to be shown as an attachment. */
+ body = native_to_utf8
+ (bodytype == 2
+ ? ("[Open the attachment \"gpgol000.htm\""
+ " to view the message.]")
+ : ("[Open the attachment \"gpgol000.txt\""
+ " to view the message.]"));
+ found = 1;
+ }
+ else
+ {
char *charset;
if (get_attach_method (att) == ATTACH_BY_VALUE)
Modified: trunk/src/mapihelp.h
===================================================================
--- trunk/src/mapihelp.h 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/mapihelp.h 2008-05-28 14:08:03 UTC (rev 254)
@@ -140,6 +140,7 @@
int mapi_set_gpgol_charset (LPMESSAGE obj, const char *charset);
int mapi_set_attach_hidden (LPATTACH attach);
+int mapi_test_attach_hidden (LPATTACH attach);
char *mapi_get_mime_info (LPMESSAGE msg);
Modified: trunk/src/mimeparser.c
===================================================================
--- trunk/src/mimeparser.c 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/mimeparser.c 2008-05-28 14:08:03 UTC (rev 254)
@@ -312,12 +312,14 @@
goto leave;
}
- /* The body attachment is special and should not be shown in the list
- of attachments. */
+ /* The body attachment is special and should not be shown in the
+ list of attachments. If the option body-as-attachment is used
+ and the message is protected we do set the hidden flag to
+ false. */
if (is_body)
{
prop.ulPropTag = PR_ATTACHMENT_HIDDEN;
- prop.Value.b = TRUE;
+ prop.Value.b = (ctx->protect_mode && opt.body_as_attachment)? FALSE:TRUE;
hr = HrSetOneProp ((LPMAPIPROP)newatt, &prop);
if (hr)
{
Modified: trunk/src/olflange-dlgs.cpp
===================================================================
--- trunk/src/olflange-dlgs.cpp 2008-05-28 08:15:22 UTC (rev 253)
+++ trunk/src/olflange-dlgs.cpp 2008-05-28 14:08:03 UTC (rev 254)
@@ -53,6 +53,7 @@
{ IDC_G_RECV, N_("Message receiving")},
{ IDC_PREVIEW_DECRYPT, N_("Also decrypt in preview window")},
{ IDC_PREFER_HTML, N_("Show HTML view if possible")},
+ { IDC_BODY_AS_ATTACHMENT, N_("Present encrypted message as attachment")},
{ IDC_GPG_OPTIONS, "Debug..."},
{ IDC_VERSION_INFO, "Version "VERSION " ("__DATE__")"},
@@ -191,6 +192,8 @@
!!opt.preview_decrypt, 0L);
SendDlgItemMessage (hDlg, IDC_PREFER_HTML, BM_SETCHECK,
!!opt.prefer_html, 0L);
+ SendDlgItemMessage (hDlg, IDC_BODY_AS_ATTACHMENT, BM_SETCHECK,
+ !!opt.body_as_attachment, 0L);
bMsgResult = FALSE; /* Accepts activation. */
break;
@@ -226,6 +229,8 @@
(hDlg, IDC_PREVIEW_DECRYPT, BM_GETCHECK, 0, 0L);
opt.prefer_html = !!SendDlgItemMessage
(hDlg, IDC_PREFER_HTML, BM_GETCHECK, 0, 0L);
+ opt.body_as_attachment = !!SendDlgItemMessage
+ (hDlg, IDC_BODY_AS_ATTACHMENT, BM_GETCHECK, 0, 0L);
/* Now that the user has confirmed the options dialog, we
mark the Registry with revision of this build. */
More information about the Gnupg-commits
mailing list