[evolution-data-server] Bug 382684 - Skip list ID prefixes in group by	subject fallback
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [evolution-data-server] Bug 382684 - Skip list ID prefixes in group by	subject fallback
- Date: Wed, 13 May 2015 16:59:32 +0000 (UTC)
commit b35b1dd1250f1302f3b8512d95bd9eb991889955
Author: Milan Crha <mcrha redhat com>
Date:   Wed May 13 18:58:35 2015 +0200
    Bug 382684 - Skip list ID prefixes in group by subject fallback
 camel/camel-folder-thread.c |   36 +++++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-folder-thread.c b/camel/camel-folder-thread.c
index af516e7..4db79b1 100644
--- a/camel/camel-folder-thread.c
+++ b/camel/camel-folder-thread.c
@@ -155,6 +155,38 @@ hashloop (gpointer key,
 }
 
 static gchar *
+skip_list_ids (gchar *s)
+{
+       gchar *p;
+
+       while (isspace (*s))
+               s++;
+
+       while (*s == '[') {
+               p = s + 1;
+
+               while (*p && *p != ']' && !isspace (*p))
+                       p++;
+
+               if (*p != ']')
+                       break;
+
+               s = p + 1;
+
+               while (isspace (*s))
+                       s++;
+
+               if (*s == '-' && isspace (s[1]))
+                       s += 2;
+
+               while (isspace (*s))
+                       s++;
+       }
+
+       return s;
+}
+
+static gchar *
 get_root_subject (CamelFolderThreadNode *c)
 {
        gchar *s, *p;
@@ -176,6 +208,8 @@ get_root_subject (CamelFolderThreadNode *c)
                }
        }
        if (s != NULL) {
+               s = skip_list_ids (s);
+
                while (*s) {
                        while (isspace (*s))
                                s++;
@@ -188,7 +222,7 @@ get_root_subject (CamelFolderThreadNode *c)
                                        p++;
                                if (*p == ':') {
                                        c->re = TRUE;
-                                       s = p + 1;
+                                       s = skip_list_ids (p + 1);
                                } else
                                        break;
                        } else
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]