From e5bfd5539c28c409368e010241671c3bb19476d7 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows)" <rob@synchro.net>
Date: Sat, 28 Jan 2023 17:28:06 -0800
Subject: [PATCH] Report the telegram waiting and node-msg waiting statuses
 separately (M and N)

I noticed that the node status displayed by load/presence_lib.js (e.g. used
by exec/nodelist.js) would have (N) for node-message waiting instead of (M)
as is reported in other places (e.g. the node utility, umonitor, sbbsctrl).
So this commit commonizes this behavior.

Now, it's crazy that there are (at least) 3 places that this node status
display is implemented and more things should just use nodestatus() to get
that string, but I'm not solving that copy/pasta issue in this commit.
---
 src/sbbs3/node.c    | 4 +++-
 src/sbbs3/userdat.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/sbbs3/node.c b/src/sbbs3/node.c
index 9a3f6467e3..cef55f5df2 100644
--- a/src/sbbs3/node.c
+++ b/src/sbbs3/node.c
@@ -407,8 +407,10 @@ void printnodedat(int number, node_t node)
 			putchar('A');
 		if(node.misc&NODE_LOCK)
 			putchar('L');
-		if(node.misc&(NODE_MSGW|NODE_NMSG))
+		if(node.misc&NODE_MSGW)
 			putchar('M');
+		if(node.misc&NODE_NMSG)
+			putchar('N');
 		if(node.misc&NODE_POFF)
 			putchar('P');
 		putchar(')');
diff --git a/src/sbbs3/userdat.c b/src/sbbs3/userdat.c
index 76aca26ba2..d032000c44 100644
--- a/src/sbbs3/userdat.c
+++ b/src/sbbs3/userdat.c
@@ -1399,8 +1399,10 @@ char* nodestatus(scfg_t* cfg, node_t* node, char* buf, size_t buflen, int num)
             strcat(str,"A");
         if(node->misc&NODE_LOCK)
             strcat(str,"L");
-        if(node->misc&(NODE_MSGW|NODE_NMSG))
+        if(node->misc&NODE_MSGW)
             strcat(str,"M");
+        if(node->misc&NODE_NMSG)
+            strcat(str,"N");
         if(node->misc&NODE_POFF)
             strcat(str,"P");
         strcat(str,")");
-- 
GitLab