shithub: plan9front

Download patch

ref: 34ed7f7aa25b3d4b6990d454b63b6b11441c3e5a
parent: c20f68f8017f98df3613108a17087d56125392b7
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Feb 1 23:38:40 EST 2021

Mail: only clear upas-maintained flags on change (thanks deuteron)

When message flags change, Mail would clear all the flags and
recompute them. This would clobber internal flags like Ftodel.
So, don't do that.

--- a/sys/src/cmd/upas/Mail/mbox.c
+++ b/sys/src/cmd/upas/Mail/mbox.c
@@ -321,7 +321,7 @@
 		return nil;
 	free(m->mflags);
 	m->mflags = f;
-	m->flags = 0;
+	m->flags &= ~(Fdel|Fseen|Fresp);
 	if(strchr(m->mflags, 'd')) m->flags |= Fdel;
 	if(strchr(m->mflags, 's')) m->flags |= Fseen;
 	if(strchr(m->mflags, 'a')) m->flags |= Fresp;
@@ -797,7 +797,6 @@
 
 	digest = plumblookup(pm->attr, "digest");
 	action = plumblookup(pm->attr, "mailtype");
-//	fprint(2, "changing message %s, %s %s\n", action, pm->data, digest);
 	if(strcmp(action, "new") == 0){
 		if((m = load(pm->data, digest, 1)) == nil)
 			return;