isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 7710b3dcb572b32d184d07d0a5687bac8e023917
parent bf26a663da9e541c910b7565bfbb9b6d45f51f7e
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Thu, 29 Sep 2005 21:07:20 +0000

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.

Diffstat:
Msrc/drv_maildir.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 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; }