From 76b8dbf6391c455beb300fe69166b57f56244783 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 2 Mar 2004 21:51:45 +0000 Subject: Overrides the parent method. We don't want to encode user flags/tags or 2004-03-02 Jeffrey Stedfast * providers/local/camel-mbox-summary.c (mbox_summary_encode_x_evolution): Overrides the parent method. We don't want to encode user flags/tags or the size of the header will change and force a complete rewrite of the mbox file. svn path=/trunk/; revision=24937 --- camel/ChangeLog | 9 ++++++++- camel/providers/local/camel-mbox-summary.c | 23 ++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 1932b03d14..84adfa5ec4 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2004-03-02 Jeffrey Stedfast + + * providers/local/camel-mbox-summary.c + (mbox_summary_encode_x_evolution): Overrides the parent method. We + don't want to encode user flags/tags or the size of the header + will change and force a complete rewrite of the mbox file. + 2004-02-25 Jeffrey Stedfast * camel-filter-driver.c (camel_filter_driver_filter_folder): Free @@ -9,7 +16,7 @@ corruption if using Heimdal's implementation of Kerberos5. Yay Heimdal. -2004-02-25 +2004-02-25 Radek Doulik * camel-folder.c (get_unread_message_count): do not avoid junk mails in unread count diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c index ac87fd2476..c34df06114 100644 --- a/camel/providers/local/camel-mbox-summary.c +++ b/camel/providers/local/camel-mbox-summary.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "camel-mbox-summary.h" #include "camel/camel-file-utils.h" @@ -55,6 +56,8 @@ static CamelMessageInfo * message_info_load (CamelFolderSummary *, FILE *); static int message_info_save (CamelFolderSummary *, FILE *, CamelMessageInfo *); /*static void message_info_free (CamelFolderSummary *, CamelMessageInfo *);*/ +static char *mbox_summary_encode_x_evolution (CamelLocalSummary *cls, const CamelMessageInfo *mi); + static int mbox_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex); static int mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex); #ifdef STATUS_PINE @@ -113,7 +116,8 @@ camel_mbox_summary_class_init(CamelMboxSummaryClass *klass) sklass->message_info_load = message_info_load; sklass->message_info_save = message_info_save; /*sklass->message_info_free = message_info_free;*/ - + + lklass->encode_x_evolution = mbox_summary_encode_x_evolution; lklass->check = mbox_summary_check; lklass->sync = mbox_summary_sync; #ifdef STATUS_PINE @@ -164,6 +168,23 @@ void camel_mbox_summary_xstatus(CamelMboxSummary *mbs, int state) mbs->xstatus = state; } +static char * +mbox_summary_encode_x_evolution (CamelLocalSummary *cls, const CamelMessageInfo *mi) +{ + const char *p, *uidstr; + guint32 uid; + + p = uidstr = camel_message_info_uid (mi); + while (*p && isdigit (*p)) + p++; + + if (*p == 0 && sscanf (uidstr, "%u", &uid) == 1) { + return g_strdup_printf ("%08x-%04x", uid, mi->flags & 0xffff); + } else { + return g_strdup_printf ("%s-%04x", uidstr, mi->flags & 0xffff); + } +} + static int summary_header_load(CamelFolderSummary *s, FILE *in) { -- cgit v1.2.3