shithub: Nail

Download patch

ref: e3d7f2d9f73bc96ced073200e7001ecf29c3256e
parent: 1fc867634ab5ed733786ab86ea0fc47eb9e6d22e
author: Ori Bernstein <[email protected]>
date: Sat Nov 14 11:47:59 EST 2020

Show both upthread and downthread links.

--- a/mesg.c
+++ b/mesg.c
@@ -238,8 +238,14 @@
 
 	if((wfd = winopen(m, "body", OWRITE)) == -1)
 		return -1;
-	if(m->parent != nil && m->parent->name != nil)
-		fprint(wfd, "Upthread: %s\n", m->parent->name);
+	if(m->parent != nil || m->nchild != 0) {
+		fprint(wfd, "Thread:");
+		if(m->parent && !(m->parent->state & Sdummy))
+			fprint(wfd, " ↑ %s", m->parent->name);
+		for(i = 0; i < m->nchild; i++)
+			fprint(wfd, " ↓ %s", m->child[i]->name);
+		fprint(wfd, "\n");
+	}
 	fprint(wfd, "From: %s\n", m->fromcolon);
 	fprint(wfd, "To:   %s\n", m->to);
 	fprint(wfd, "Date: %s\n", m->date);