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.
This commit is contained in:
Oswald Buddenhagen 2005-09-29 21:07:20 +00:00
parent bf26a663da
commit 7710b3dcb5

View File

@ -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;
}