From 8b59286ef1d9bef6c2c7b248ab0b8072e25ec9cf Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Wed, 5 Feb 2020 14:11:15 -0800 Subject: [PATCH] upas/fs plumb modify messages for self-changed flags Currently upas/fs plumbs modify messages only if the flag changes are made by another imap connection. If the flag changes are made within the running upas/fs no modify message is plumbed. This changes upas/fs to set the modify flag if we made the change ourself. It also moves the flag setting before the imap read, so that we don't clobber flag changes coming from the imap server with our own flags. (Thanks Tobias Heinicke) --- sys/src/cmd/upas/fs/fs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/src/cmd/upas/fs/fs.c b/sys/src/cmd/upas/fs/fs.c index fbb515928..df3ea3829 100644 --- a/sys/src/cmd/upas/fs/fs.c +++ b/sys/src/cmd/upas/fs/fs.c @@ -1193,10 +1193,11 @@ modflags(Mailbox *mb, Message *m, char *p) if(err = txflags(p, &f)) return err; if(f != m->flags){ - if(mb->modflags != nil) - mb->modflags(mb, m, f); m->flags = f; m->cstate |= Cidxstale; + m->cstate |= Cmod; + if(mb->modflags != nil) + mb->modflags(mb, m, f); } return nil; }