[geary: 19/23] Remove redundant call to set the GMime.Parser format; Add some comments
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 19/23] Remove redundant call to set the GMime.Parser format; Add some comments
- Date: Sat, 21 Dec 2019 05:43:30 +0000 (UTC)
commit 437429440008cc22acd9bd5edfc75130ddeb5852
Author: Torben <torben letorbi gmail com>
Date: Tue Dec 17 12:16:06 2019 +0100
Remove redundant call to set the GMime.Parser format; Add some comments
src/engine/rfc822/rfc822-message-data.vala | 5 +++--
src/engine/rfc822/rfc822-message.vala | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/engine/rfc822/rfc822-message-data.vala b/src/engine/rfc822/rfc822-message-data.vala
index bd7dda7c..d4a3aa0a 100644
--- a/src/engine/rfc822/rfc822-message-data.vala
+++ b/src/engine/rfc822/rfc822-message-data.vala
@@ -312,8 +312,6 @@ public class Geary.RFC822.Header : Geary.MessageData.BlockMessageData, Geary.RFC
GMime.Parser parser = new GMime.Parser.with_stream(Utils.create_stream_mem(buffer));
parser.set_respect_content_length(false);
- // TODO Could this be omitted?
- parser.set_format(GMime.Format.MESSAGE);
message = parser.construct_message(Geary.RFC822.get_parser_options());
if (message == null)
@@ -325,6 +323,9 @@ public class Geary.RFC822.Header : Geary.MessageData.BlockMessageData, Geary.RFC
public string? get_header(string name) throws RFC822Error {
GMime.Header header = get_headers().get_header(name);
if (header != null)
+ // We should not parse the raw-value here, but use GMime's parsing
+ // functionality instead.
+ // See: https://gitlab.gnome.org/GNOME/geary/merge_requests/382#note_669699
return GMime.utils_header_unfold(header.get_raw_value());
else
return null;
diff --git a/src/engine/rfc822/rfc822-message.vala b/src/engine/rfc822/rfc822-message.vala
index fe606582..e14093e3 100644
--- a/src/engine/rfc822/rfc822-message.vala
+++ b/src/engine/rfc822/rfc822-message.vala
@@ -895,6 +895,9 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
for (int i = 0; i < headers.get_count(); i++) {
GMime.Header header = headers.get_header_at(i);
string name = header.get_name();
+ // We should not parse the raw-value here, but use GMime's parsing
+ // functionality instead.
+ // See: https://gitlab.gnome.org/GNOME/geary/merge_requests/382#note_669699
string value = GMime.utils_header_unfold(header.get_raw_value());
switch (name.down()) {
case "from":
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]