mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
upas/Mail: don't move cursor when flags are unchanged
when doing bulk operations one after the other, like mass-marking messages read, the cursor tends to jump to update the messages, but they're already in the right state; don't do that.
This commit is contained in:
parent
03cb81c7a5
commit
b9955e29d1
1 changed files with 4 additions and 0 deletions
|
@ -313,17 +313,21 @@ change(char *name, char *digest)
|
|||
{
|
||||
Mesg *m;
|
||||
char *f;
|
||||
int old;
|
||||
|
||||
if((m = mesglookup(name, digest)) == nil)
|
||||
return nil;
|
||||
if((f = rslurp(m, "flags", nil)) == nil)
|
||||
return nil;
|
||||
old = m->flags;
|
||||
free(m->mflags);
|
||||
m->mflags = f;
|
||||
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;
|
||||
if(old == m->flags)
|
||||
return nil;
|
||||
return m;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue