commit fbc0627c83e9baeb82f4427f32d8be29cad41c2c
parent 681b0766cfd81b748d09b8239726ade553e7deea
Author: Paul <paul@claws-mail.org>
Date: Wed, 8 Feb 2023 13:12:50 +0000
fix bug 4658, 'Headers unfolded incorrectly in message view'
based on patch by Viatrix
Diffstat:
6 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/AUTHORS b/AUTHORS
@@ -342,4 +342,5 @@ contributors (in addition to the above; based on Changelog)
Ramin Yaghoubzadeh Torky
Manuel Stoeckl
Frank Mueller
- JP Guillonneau
+ JP Guillonneau
+ Viatrix
diff --git a/src/gtk/authors.h b/src/gtk/authors.h
@@ -317,6 +317,7 @@ static char *CONTRIBS_LIST[] = {
"Aleksandar Urošević",
"Petr Vanek",
"Jeroen Versteeg",
+"Viatrix",
"Kevin Vigor",
"Michael Vilain",
"Johan Vromans",
diff --git a/src/mimeview.c b/src/mimeview.c
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2023 the Claws Mail team and Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1669,7 +1669,7 @@ static void mimeview_drag_data_get(GtkWidget *widget,
fp = claws_fopen(partinfo->data.filename, "rb");
if (fp != NULL && fseek(fp, partinfo->offset, SEEK_SET) == 0) {
- headers = procheader_get_header_array_asis(fp);
+ headers = procheader_get_header_array(fp);
if (headers) {
gint i;
for (i = 0; i < headers->len; i++) {
diff --git a/src/procheader.c b/src/procheader.c
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2014 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2023 the Claws Mail team and Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -265,7 +265,7 @@ gint procheader_get_one_field_asis(gchar **buf, FILE *fp)
FALSE);
}
-GPtrArray *procheader_get_header_array_asis(FILE *fp)
+GPtrArray *procheader_get_header_array(FILE *fp)
{
gchar *buf = NULL;
GPtrArray *headers;
@@ -275,7 +275,7 @@ GPtrArray *procheader_get_header_array_asis(FILE *fp)
headers = g_ptr_array_new();
- while (procheader_get_one_field_asis(&buf, fp) != -1) {
+ while (procheader_get_one_field(&buf, fp, NULL) != -1) {
if ((header = procheader_parse_header(buf)) != NULL)
g_ptr_array_add(headers, header);
g_free(buf);
diff --git a/src/procheader.h b/src/procheader.h
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2014 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2023 the Claws Mail team and Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ gint procheader_get_one_field (gchar **buf,
gint procheader_get_one_field_asis (gchar **buf,
FILE *fp);
-GPtrArray *procheader_get_header_array_asis (FILE *fp);
+GPtrArray *procheader_get_header_array (FILE *fp);
void procheader_header_array_destroy (GPtrArray *harray);
void procheader_header_free (Header *header);
diff --git a/src/textview.c b/src/textview.c
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2023 the Claws Mail team and Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1926,10 +1926,11 @@ static GPtrArray *textview_scan_header(TextView *textview, FILE *fp)
cm_return_val_if_fail(fp != NULL, NULL);
if (prefs_common.show_all_headers) {
- headers = procheader_get_header_array_asis(fp);
+ headers = procheader_get_header_array(fp);
sorted_headers = g_ptr_array_new();
for (i = 0; i < headers->len; i++) {
header = g_ptr_array_index(headers, i);
+ unfold_line(header->body);
if (!procheader_header_is_internal(header->name))
g_ptr_array_add(sorted_headers, header);
else
@@ -1945,7 +1946,7 @@ static GPtrArray *textview_scan_header(TextView *textview, FILE *fp)
return NULL;
}
- headers = procheader_get_header_array_asis(fp);
+ headers = procheader_get_header_array(fp);
sorted_headers = g_ptr_array_new();
@@ -1956,7 +1957,7 @@ static GPtrArray *textview_scan_header(TextView *textview, FILE *fp)
for (i = 0; i < headers->len; i++) {
header = g_ptr_array_index(headers, i);
-
+ unfold_line(header->body);
if (procheader_headername_equal(header->name,
dp->name)) {
if (dp->hidden)
@@ -1973,6 +1974,7 @@ static GPtrArray *textview_scan_header(TextView *textview, FILE *fp)
if (prefs_common.show_other_header) {
for (i = 0; i < headers->len; i++) {
header = g_ptr_array_index(headers, i);
+ unfold_line(header->body);
if (!procheader_header_is_internal(header->name)) {
g_ptr_array_add(sorted_headers, header);
} else {