[evolution-data-server] Bug 300871 - Ignore a specific thread



commit c7e11d9208a1a0fe23bdf0d34da946b236986648
Author: Milan Crha <mcrha redhat com>
Date:   Mon Oct 27 22:11:01 2014 +0100

    Bug 300871 - Ignore a specific thread
    
    Added filters to get 'msgid' and 'references' from the folder summary
    encoded as MD5 checksums (like in the CamelMessageInfo members).

 camel/camel-search-sql-sexp.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-search-sql-sexp.c b/camel/camel-search-sql-sexp.c
index 6e3f6e7..5d98e0e 100644
--- a/camel/camel-search-sql-sexp.c
+++ b/camel/camel-search-sql-sexp.c
@@ -190,7 +190,25 @@ eval_eq (struct _CamelSExp *f,
                else if (r1->type == CAMEL_SEXP_RES_STRING)
                        g_string_append_printf (str, "%s", r1->value.string);
 
-               if (!strstr (str->str, "completed-on") && !strstr (str->str, "follow-up")) {
+               if (g_str_equal (str->str, "( msgid") || g_str_equal (str->str, "( references")) {
+                       gboolean is_msgid = g_str_equal (str->str, "( msgid");
+
+                       g_string_assign (str, "( part LIKE ");
+                       if (r2->type == CAMEL_SEXP_RES_STRING) {
+                               gchar *tmp, *safe;
+
+                               /* Expects CamelSummaryMessageID encoded as "%lu %lu", id.part.hi, id.part.lo.
+                                  The 'msgid' is always the first, while 'references' is inside. */
+                               /* Beware, the 'references' can return false positives, thus recheck returned 
UID-s. */
+                               tmp = g_strdup_printf ("%s%s%%", is_msgid ? "" : "%", r2->value.string);
+                               safe = get_db_safe_string (tmp);
+                               g_string_append_printf (str, "%s", safe);
+                               g_free (safe);
+                               g_free (tmp);
+                       } else {
+                               g_warn_if_reached ();
+                       }
+               } else if (!strstr (str->str, "completed-on") && !strstr (str->str, "follow-up")) {
                        gboolean ut = FALSE;
 
                        if (strstr (str->str, "usertags"))


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