shithub: Nail

Download patch

ref: 154fcdbc15a25742bf471ebba54c90f0c1228231
parent: 3206f8877f32b4559c053446cec774ab42d33f96
author: Ori Bernstein <[email protected]>
date: Fri Jan 29 11:28:11 EST 2021

compose: remove 'Q' button.

what kind of monster doesn't quote messages?

--- a/comp.c
+++ b/comp.c
@@ -244,7 +244,7 @@
 }
 
 void
-compose(char *to, Mesg *r, int quote, int all)
+compose(char *to, Mesg *r, int all)
 {
 	static int ncompose;
 	Biobuf *rfd, *wfd;
@@ -273,13 +273,12 @@
 		if(r->subject != nil && cistrncmp(r->subject, "Re", 2) != 0)
 			Bprint(wfd, "Re: ");
 		Bprint(wfd, "%s\n\n", r->subject);
-		if(quote){
-			Bprint(wfd, "Quoth %s:\n", r->fromcolon);
-			rfd = openbody(r);
-			if(rfd != nil)
-				while((ln = Brdstr(rfd, '\n', 0)) != nil)
-					if(Bprint(wfd, "> %s", ln) == -1)
-						break;
+		Bprint(wfd, "Quoth %s:\n", r->fromcolon);
+		rfd = openbody(r);
+		if(rfd != nil){
+			while((ln = Brdstr(rfd, '\n', 0)) != nil)
+				if(Bprint(wfd, "> %s", ln) == -1)
+					break;
 			Bterm(rfd);
 		}
 		Bterm(wfd);
--- a/mail.h
+++ b/mail.h
@@ -181,7 +181,7 @@
 void	mbredraw(Mesg*, int, int);
 
 /* composition */
-void	compose(char*, Mesg*, int, int);
+void	compose(char*, Mesg*, int);
 
 /* utils */
 void	*emalloc(ulong);
--- a/mbox.c
+++ b/mbox.c
@@ -718,7 +718,7 @@
 static void
 mbcompose(char **, int)
 {
-	compose("", nil, 0, 0);
+	compose("", nil, 0);
 }
 
 static void
@@ -966,7 +966,7 @@
 			plumbfree(pshow);
 			break;
 		case Csendmail:
-			compose(psend->data, nil, 0, 0);
+			compose(psend->data, nil, 0);
 			plumbfree(psend);
 			break;
 		}
--- a/mesg.c
+++ b/mesg.c
@@ -300,29 +300,13 @@
 static void
 reply(Mesg *m, char **f, int nf)
 {
-	if(nf >= 2
-	|| nf >= 1 &&  strcmp(f[0], "all") != 0){
-		fprint(2, "Q: invaid args\n");
-		return;
-	}
-
-	compose(m->replyto, m, 0, nf >= 1);
+	if(nf >= 1 &&  strcmp(f[0], "all") != 0)
+		compose(m->replyto, m, 1);
+	else
+		compose(m->replyto, m, 0);
 }
 
 static void
-qreply(Mesg *m, char **f, int nf)
-{
-	if(nf >= 3
-	|| nf >= 2 && strcmp(f[1], "all") != 0
-	|| nf >= 1 && strcmp(f[0], "Reply") != 0
-	|| nf == 0){
-		fprint(2, "Q: invaid args\n");
-		return;
-	}
-	compose(m->replyto, m, 1, nf >= 2);
-}
-
-static void
 delmesg(Mesg *m, char **, int nf)
 {
 	if(nf != 0){
@@ -375,7 +359,6 @@
 }
 
 static Fn mesgfn[] = {
-	{"Q",		qreply},
 	{"Reply",	reply},
 	{"Delmesg",	delmesg},
 	{"Del", 	mesgquit},
@@ -404,7 +387,7 @@
 	wininit(m, path);
 	free(path);
 
-	wintagwrite(m, "Q Reply all Delmesg Save  ");
+	wintagwrite(m, "Reply all Delmesg Save  ");
 	mesgshow(m);
 	fprint(m->ctl, "clean\n");
 	mbox.nopen++;