From 7710b3dcb572b32d184d07d0a5687bac8e023917 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 29 Sep 2005 21:07:20 +0000 Subject: [PATCH] make flag changes unset "new" status - unless a ghost is acting in the background, a flag change indicates that the message was at least noticed. --- src/drv_maildir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/drv_maildir.c b/src/drv_maildir.c index b2d1635..3b27497 100644 --- a/src/drv_maildir.c +++ b/src/drv_maildir.c @@ -1010,13 +1010,15 @@ maildir_set_flags( store_t *gctx, message_t *gmsg, int uid, int add, int del ) (void) uid; bbl = nfsnprintf( buf, sizeof(buf), "%s/", gctx->path ); + memcpy( nbuf, gctx->path, bbl - 1 ); + memcpy( nbuf + bbl - 1, "/cur/", 5 ); for (;;) { bl = bbl + nfsnprintf( buf + bbl, sizeof(buf) - bbl, "%s/", subdirs[gmsg->status & M_RECENT] ); ol = strlen( msg->base ); if ((int)sizeof(buf) - bl < ol + 3 + NUM_FLAGS) oob(); memcpy( buf + bl, msg->base, ol + 1 ); - memcpy( nbuf, buf, bl + ol + 1 ); + memcpy( nbuf + bl, msg->base, ol + 1 ); if ((s = strstr( nbuf + bl, ":2," ))) { s += 3; fl = ol - (s - (nbuf + bl)); @@ -1047,6 +1049,7 @@ maildir_set_flags( store_t *gctx, message_t *gmsg, int uid, int add, int del ) memcpy( msg->base, nbuf + bl, tl + 1 ); msg->gen.flags |= add; msg->gen.flags &= ~del; + gmsg->status &= ~M_RECENT; return DRV_OK; }