[evolution-data-server/gnome-3-10] Bug #712578 - MH folder refresh can cause summary rebuild



commit e41baf5083a4a6a092347bc47509df5494cfd195
Author: Milan Crha <mcrha redhat com>
Date:   Wed Nov 27 16:03:36 2013 +0100

    Bug #712578 - MH folder refresh can cause summary rebuild

 camel/providers/local/camel-mh-summary.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index dd22b17..d5c7737 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -47,6 +47,7 @@
 
 static gint mh_summary_check (CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, GCancellable 
*cancellable, GError **error);
 static gint mh_summary_sync (CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, 
GCancellable *cancellable, GError **error);
+static gint mh_summary_decode_x_evolution (CamelLocalSummary *cls, const gchar *xev, CamelLocalMessageInfo 
*info);
 /*static gint mh_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, CamelMessageInfo *info, 
CamelFolderChangeInfo *, GError **error);*/
 
 static gchar *mh_summary_next_uid_string (CamelFolderSummary *s);
@@ -71,6 +72,7 @@ camel_mh_summary_class_init (CamelMhSummaryClass *class)
        local_summary_class = CAMEL_LOCAL_SUMMARY_CLASS (class);
        local_summary_class->check = mh_summary_check;
        local_summary_class->sync = mh_summary_sync;
+       local_summary_class->decode_x_evolution = mh_summary_decode_x_evolution;
 }
 
 static void
@@ -173,14 +175,17 @@ camel_mh_summary_add (CamelLocalSummary *cls,
        if (cls->index && (forceindex || !camel_index_has_name (cls->index, name))) {
                d (printf ("forcing indexing of message content\n"));
                camel_folder_summary_set_index ((CamelFolderSummary *) mhs, cls->index);
+               cls->index_force = TRUE;
        } else {
                camel_folder_summary_set_index ((CamelFolderSummary *) mhs, NULL);
+               cls->index_force = FALSE;
        }
        mhs->priv->current_uid = (gchar *) name;
        camel_folder_summary_add_from_parser ((CamelFolderSummary *) mhs, mp);
        g_object_unref (mp);
        mhs->priv->current_uid = NULL;
        camel_folder_summary_set_index ((CamelFolderSummary *) mhs, NULL);
+       cls->index_force = FALSE;
        g_free (filename);
        return 0;
 }
@@ -343,3 +348,28 @@ mh_summary_sync (CamelLocalSummary *cls,
        local_summary_class = CAMEL_LOCAL_SUMMARY_CLASS (camel_mh_summary_parent_class);
        return local_summary_class->sync (cls, expunge, changes, cancellable, error);
 }
+
+static gint
+mh_summary_decode_x_evolution (CamelLocalSummary *cls,
+                              const gchar *xev,
+                              CamelLocalMessageInfo *info)
+{
+       CamelLocalSummaryClass *local_summary_class;
+       CamelMhSummary *mh_summary;
+       gint ret;
+
+       local_summary_class = CAMEL_LOCAL_SUMMARY_CLASS (camel_mh_summary_parent_class);
+       ret = local_summary_class->decode_x_evolution (cls, xev, info);
+
+       if (ret == -1)
+               return ret;
+
+       /* do not use UID from the header, rather use the one provided, if any */
+       mh_summary = CAMEL_MH_SUMMARY (cls);
+       if (mh_summary->priv->current_uid) {
+               camel_pstring_free (info->info.uid);
+               info->info.uid = camel_pstring_strdup (mh_summary->priv->current_uid);
+       }
+
+       return ret;
+}


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