changeset 9253:45b110c8da62 HEAD

lazy-expunge: Drop \Deleted flag when moving message.
author Timo Sirainen <tss@iki.fi>
date Sun, 26 Jul 2009 20:01:44 -0400
parents 88d4e83fcea5
children d6fcb6d050ba
files src/plugins/lazy-expunge/lazy-expunge-plugin.c
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Sun Jul 26 19:51:37 2009 -0400
+++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Sun Jul 26 20:01:44 2009 -0400
@@ -150,11 +150,25 @@
 			     const char *path, void *context)
 {
 	struct lazy_expunge_move_context *ctx = context;
-	const char *p;
+	const char *p, *p2;
 
 	str_truncate(ctx->path, ctx->dir_len);
 	p = strrchr(path, '/');
-	str_append(ctx->path, p == NULL ? path : p + 1);
+	if (p == NULL)
+		p = path;
+	else
+		p++;
+
+	/* drop \Deleted flag */
+	p2 = strstr(p, MAILDIR_FLAGS_FULL_SEP);
+	if (p2 != NULL)
+		p2 = strchr(p2, 'T');
+	if (p2 == NULL)
+		str_append(ctx->path, p);
+	else {
+		str_append_n(ctx->path, p, p2 - p);
+		str_append(ctx->path, p2 + 1);
+	}
 
 	if (rename(path, str_c(ctx->path)) == 0)
 		return 1;