[evolution-data-server] I#151 - Camel: Correct result of the "is" filter condition on address headers



commit f7c18236bac145967f4676ce6ed4da0946ec75a6
Author: Milan Crha <mcrha redhat com>
Date:   Mon Sep 9 18:55:10 2019 +0200

    I#151 - Camel: Correct result of the "is" filter condition on address headers
    
    Closes https://gitlab.gnome.org/GNOME/evolution-data-server/issues/151

 src/camel/camel-search-private.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/camel/camel-search-private.c b/src/camel/camel-search-private.c
index cd5622427..de6514d42 100644
--- a/src/camel/camel-search-private.c
+++ b/src/camel/camel-search-private.c
@@ -495,10 +495,15 @@ camel_search_header_match (const gchar *value,
                else
                        camel_address_unformat ((CamelAddress *) cia, value);
 
-               for (i = 0; !truth && camel_internet_address_get (cia, i, &name, &addr); i++)
+               for (i = 0; !truth && camel_internet_address_get (cia, i, &name, &addr) && (!i || how != 
CAMEL_SEARCH_MATCH_EXACT); i++) {
                        truth =
                                (name && header_match (name, match, how)) ||
                                (addr && header_match (addr, match, how));
+               }
+
+               if (truth && how == CAMEL_SEARCH_MATCH_EXACT &&
+                   camel_address_length (CAMEL_ADDRESS (cia)) > 1)
+                       truth = FALSE;
 
                g_object_unref (cia);
                break;


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