[geary/mjog/fix-null-message-ids: 3/4] Fix headers not being parsed due to case differences



commit 39b5f7922b50ff82ee8e9c51b1cdda6313f4db6c
Author: Michael Gratton <mike vee net>
Date:   Fri Nov 1 15:43:22 2019 +1100

    Fix headers not being parsed due to case differences
    
    Commit 8cd310be broke case-insensitive header parsing since it went
    from using GMime's header class to using a Gee.Map for header response
    lookup. This patch makes the map use case-insensitive keys.

 src/engine/imap/api/imap-folder-session.vala | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/engine/imap/api/imap-folder-session.vala b/src/engine/imap/api/imap-folder-session.vala
index 828fc1da..c6d9a91b 100644
--- a/src/engine/imap/api/imap-folder-session.vala
+++ b/src/engine/imap/api/imap-folder-session.vala
@@ -867,7 +867,11 @@ private class Geary.Imap.FolderSession : Geary.Imap.SessionObject {
 
         // if any headers were requested, convert its fields now
         if (header_specifiers != null) {
-            Gee.Map<string,string> headers = new Gee.HashMap<string,string>();
+            // Header fields are case insensitive, so use a
+            // case-insensitive map.
+            Gee.Map<string,string> headers = new Gee.HashMap<string,string>(
+                String.stri_hash, String.stri_equal
+            );
             foreach (FetchBodyDataSpecifier header_specifier in header_specifiers) {
                 Memory.Buffer fetched_headers =
                     fetched_data.body_data_map.get(header_specifier);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]