diff options
Diffstat (limited to 'camel/providers/local/camel-mbox-summary.c')
-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) { |