[Commits] [SCM] claws branch, master, updated. 3.15.0-61-g61ec4ca
ticho at claws-mail.org
ticho at claws-mail.org
Wed May 31 20:39:55 CEST 2017
The branch, master has been updated
via 61ec4cae4410ebe0ecb652c7c96000301950ecc8 (commit)
from 56425d67c7fbb47709fb083ea0812659a9a9a7e7 (commit)
Summary of changes:
src/textview.c | 13 +++++++++++--
src/textview.h | 1 +
2 files changed, 12 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit 61ec4cae4410ebe0ecb652c7c96000301950ecc8
Author: Andrej Kacian <ticho at claws-mail.org>
Date: Wed May 31 20:38:59 2017 +0200
Do not try to handle quotes in text attachments.
Closes Bug 3824 - Quotation Folding is wrongly applied to text
attachments.
diff --git a/src/textview.c b/src/textview.c
index 7372a1c..c9be5d8 100644
--- a/src/textview.c
+++ b/src/textview.c
@@ -1074,6 +1074,7 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
textview->is_in_signature = FALSE;
textview->is_diff = FALSE;
+ textview->is_attachment = FALSE;;
procmime_decode_content(mimeinfo);
@@ -1174,6 +1175,13 @@ textview_default:
|| !g_ascii_strcasecmp(mimeinfo->subtype, "x-diff"))
textview->is_diff = TRUE;
+ /* Displayed part is an attachment, but not an attached
+ * e-mail. Set a flag, so that elsewhere in the code we
+ * know not to try making collapsible quotes in it. */
+ if (mimeinfo->disposition == DISPOSITIONTYPE_ATTACHMENT &&
+ mimeinfo->type != MIMETYPE_MESSAGE)
+ textview->is_attachment = TRUE;
+
if (mimeinfo->content == MIMECONTENT_MEM)
tmpfp = str_open_as_stream(mimeinfo->data.mem);
else
@@ -1597,7 +1605,8 @@ static void textview_write_line(TextView *textview, const gchar *str,
>, foo>, _> ... ok, <foo>, foo bar>, foo-> ... ng
Up to 3 levels of quotations are detected, and each
level is colored using a different color. */
- if (prefs_common.enable_color
+ if (prefs_common.enable_color
+ && !textview->is_attachment
&& line_has_quote_char(buf, prefs_common.quote_chars)) {
real_quotelevel = get_quote_level(buf, prefs_common.quote_chars);
quotelevel = real_quotelevel;
@@ -1640,7 +1649,7 @@ static void textview_write_line(TextView *textview, const gchar *str,
}
}
- if (real_quotelevel > -1 && do_quote_folding) {
+ if (!textview->is_attachment && real_quotelevel > -1 && do_quote_folding) {
if (!g_utf8_validate(buf, -1, NULL)) {
gchar *utf8buf = NULL;
utf8buf = g_malloc(BUFFSIZE);
diff --git a/src/textview.h b/src/textview.h
index 51b7643..35393a2 100644
--- a/src/textview.h
+++ b/src/textview.h
@@ -66,6 +66,7 @@ struct _TextView
gboolean default_text;
gboolean is_in_signature;
gboolean is_diff;
+ gboolean is_attachment;
GSList *uri_list;
gint body_pos;
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list