[geary/mjog/misc-criticals: 6/9] Geary.RFC822.Header: Add get_raw_header
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/misc-criticals: 6/9] Geary.RFC822.Header: Add get_raw_header
- Date: Sat, 27 Jun 2020 02:32:45 +0000 (UTC)
commit 8125ab8c3bda705fe5f9d54e2499b2806c0f1715
Author: Michael Gratton <mike vee net>
Date: Fri Jun 26 17:20:02 2020 +1000
Geary.RFC822.Header: Add get_raw_header
Add header accessor to enable getting raw header values when needed.
src/engine/rfc822/rfc822-message-data.vala | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/engine/rfc822/rfc822-message-data.vala b/src/engine/rfc822/rfc822-message-data.vala
index 48b1d6f7e..01a854e98 100644
--- a/src/engine/rfc822/rfc822-message-data.vala
+++ b/src/engine/rfc822/rfc822-message-data.vala
@@ -285,7 +285,7 @@ public class Geary.RFC822.Subject :
}
public Subject.from_rfc822_string(string rfc822) {
- base(GMime.utils_header_decode_text(get_parser_options(), rfc822));
+ base(GMime.utils_header_decode_text(get_parser_options(), rfc822).strip());
this.rfc822 = rfc822;
}
@@ -391,6 +391,15 @@ public class Geary.RFC822.Header :
return value;
}
+ public string? get_raw_header(string name) {
+ string? value = null;
+ var header = this.message.get_header_list().get_header(name);
+ if (header != null) {
+ value = header.get_raw_value();
+ }
+ return value;
+ }
+
public string[] get_header_names() {
if (this.names == null) {
GMime.HeaderList headers = this.message.get_header_list();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]