# HG changeset patch # User Timo Sirainen # Date 1248652904 14400 # Node ID 45b110c8da6222b0dee9834e78898f7dba3ac826 # Parent 88d4e83fcea5187af3d671a3950f5a15300f4438 lazy-expunge: Drop \Deleted flag when moving message. diff -r 88d4e83fcea5 -r 45b110c8da62 src/plugins/lazy-expunge/lazy-expunge-plugin.c --- 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;