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.
This commit is contained in:
Ori Bernstein 2021-02-01 20:38:40 -08:00
parent c20f68f801
commit 34ed7f7aa2

View file

@ -321,7 +321,7 @@ change(char *name, char *digest)
return nil; return nil;
free(m->mflags); free(m->mflags);
m->mflags = f; m->mflags = f;
m->flags = 0; m->flags &= ~(Fdel|Fseen|Fresp);
if(strchr(m->mflags, 'd')) m->flags |= Fdel; if(strchr(m->mflags, 'd')) m->flags |= Fdel;
if(strchr(m->mflags, 's')) m->flags |= Fseen; if(strchr(m->mflags, 's')) m->flags |= Fseen;
if(strchr(m->mflags, 'a')) m->flags |= Fresp; if(strchr(m->mflags, 'a')) m->flags |= Fresp;
@ -797,7 +797,6 @@ changemesg(Plumbmsg *pm)
digest = plumblookup(pm->attr, "digest"); digest = plumblookup(pm->attr, "digest");
action = plumblookup(pm->attr, "mailtype"); action = plumblookup(pm->attr, "mailtype");
// fprint(2, "changing message %s, %s %s\n", action, pm->data, digest);
if(strcmp(action, "new") == 0){ if(strcmp(action, "new") == 0){
if((m = load(pm->data, digest, 1)) == nil) if((m = load(pm->data, digest, 1)) == nil)
return; return;