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)
This commit is contained in:
Ori Bernstein 2020-02-05 14:11:15 -08:00
parent 7004384568
commit 8b59286ef1

View file

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