shithub: Nail

Download patch

ref: d401a542727f39e4b9395e82a41792e1f39916f5
parent: 83b1b96014f6e333c0987de230f7c87bc92b055b
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jan 9 20:14:38 EST 2021

mesage list: remove overzealous flag check

we were skipping showing modified messages because of
this. there's no harm in just updating, so do it.

--- a/mbox.c
+++ b/mbox.c
@@ -310,17 +310,15 @@
 }
 
 static Mesg*
-change(char *name, char *digest, int *cf)
+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 = 0;
@@ -327,7 +325,6 @@
 	if(strchr(m->mflags, 'd')) m->flags |= Fdel;
 	if(strchr(m->mflags, 's')) m->flags |= Fseen;
 	if(strchr(m->mflags, 'a')) m->flags |= Fresp;
-	*cf = (old != m->flags);
 	return m;
 }
 
@@ -793,7 +790,7 @@
 {
 	char *digest, *action;
 	Mesg *m, *r;
-	int ln, nr, cf;
+	int ln, nr;
 
 	digest = plumblookup(pm->attr, "digest");
 	action = plumblookup(pm->attr, "mailtype");
@@ -834,7 +831,7 @@
 		if((m = delete(pm->data, digest)) != nil)
 			mbredraw(m, 0, 0);
 	}else if(strcmp(action, "modify") == 0){
-		if((m = change(pm->data, digest, &cf)) != nil && cf)
+		if((m = change(pm->data, digest)) != nil)
 			mbredraw(m, 0, 0);
 	}
 }