shithub: riscv

Download patch

ref: 8b59286ef1d9bef6c2c7b248ab0b8072e25ec9cf
parent: 70043845680fe6737b21215021e011880969fb78
author: Ori Bernstein <[email protected]>
date: Wed Feb 5 09:11:15 EST 2020

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)

--- a/sys/src/cmd/upas/fs/fs.c
+++ b/sys/src/cmd/upas/fs/fs.c
@@ -1193,10 +1193,11 @@
 	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;
 }