diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-03-03 05:51:45 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-03-03 05:51:45 +0800 |
commit | 76b8dbf6391c455beb300fe69166b57f56244783 (patch) | |
tree | d0bbca565a393617366075fbd2004aee8e07ee3a /camel/providers | |
parent | 5c955ac50f5e749d8b6fcf89d0e0820345734c2a (diff) | |
download | gsoc2013-evolution-76b8dbf6391c455beb300fe69166b57f56244783.tar.gz gsoc2013-evolution-76b8dbf6391c455beb300fe69166b57f56244783.tar.zst gsoc2013-evolution-76b8dbf6391c455beb300fe69166b57f56244783.zip |
Overrides the parent method. We don't want to encode user flags/tags or
2004-03-02 Jeffrey Stedfast <fejj@ximian.com>
* 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
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/local/camel-mbox-summary.c | 23 |
1 files changed, 22 insertions, 1 deletions
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 <errno.h> #include <string.h> #include <stdlib.h> +#include <ctype.h> #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) { |