fix bug 4658, 'Headers unfolded incorrectly in message view'
authorPaul <paul@claws-mail.org>
Wed, 8 Feb 2023 13:12:50 +0000 (13:12 +0000)
committerPaul <paul@claws-mail.org>
Wed, 8 Feb 2023 13:12:50 +0000 (13:12 +0000)
based on patch by Viatrix

AUTHORS
src/gtk/authors.h
src/mimeview.c
src/procheader.c
src/procheader.h
src/textview.c

diff --git a/AUTHORS b/AUTHORS
index 084b05c70a40bfa0a2fd86f87ddd474f6e0b692e..2eb6b0d77d251d2052b7cc495f44ed26cb7c65b3 100644 (file)
--- 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
index a84aa74851b5ecc2e3a9a8537be57e9bb5047a45..c1c3044bf2861d25c613485b859f05daa7a8513b 100644 (file)
@@ -317,6 +317,7 @@ static char *CONTRIBS_LIST[] = {
 "Aleksandar Urošević",
 "Petr Vanek",
 "Jeroen Versteeg",
+"Viatrix",
 "Kevin Vigor",
 "Michael Vilain",
 "Johan Vromans",
index e782dce76d9f05b5b206d4ab6ae4f8bf021c595b..ef12ed8f53e3a7df599d77e2cdc4c368674683c3 100644 (file)
@@ -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++) {
index 106deadecb6bdd04b45405322b7193490e41d907..220a808a9d2529d38ccd93089098f3b8c6a836e9 100644 (file)
@@ -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);
index 3e5681946b104928333465c890856a952a68d8a9..a5c3201d0a9186187c9987a7df028d4a4753ed36 100644 (file)
@@ -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);
 
index b986de84e341e404b1533eb999ed4aa8aec395ad..3e425e25ba89495faa85698a4d5835eed270e2ce 100644 (file)
@@ -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 {