From 7fd8372d59bc6628309e447a10397450d27b9a81 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 24 Apr 2003 07:57:10 +0000
Subject: [PATCH] nodemsg (private message prompt) now only checks node record
 once a second.

---
 src/sbbs3/chat.cpp | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/src/sbbs3/chat.cpp b/src/sbbs3/chat.cpp
index 542417e7f1..8db216f847 100644
--- a/src/sbbs3/chat.cpp
+++ b/src/sbbs3/chat.cpp
@@ -1210,6 +1210,7 @@ void sbbs_t::nodemsg()
 	char 	tmp[512];
 	int 	i,usernumber,done=0;
 	node_t	node,savenode;
+	time_t	last=0;
 
 	if(nodemsg_inside>1)	/* nested once only */
 		return;
@@ -1231,26 +1232,29 @@ void sbbs_t::nodemsg()
 				break;
 			if(sys_status&SS_ABORT)
 				break;
-			getnodedat(cfg.node_num,&thisnode,0);
-			if(thisnode.misc&(NODE_MSGW|NODE_NMSG)) {
-				lncntr=0;	/* prevent pause prompt */
-				SAVELINE;
-				CRLF;
-				if(thisnode.misc&NODE_NMSG)
-					getnmsg();
-				if(thisnode.misc&NODE_MSGW)
-					getsmsg(useron.number);
-				CRLF;
-				RESTORELINE; }
-			else
-				nodesync();
-			gettimeleft();
-			checkline(); }
+			if(last!=now && getnodedat(cfg.node_num,&thisnode,false)==0) {
+				if(thisnode.misc&(NODE_MSGW|NODE_NMSG)) {
+					lncntr=0;	/* prevent pause prompt */
+					SAVELINE;
+					CRLF;
+					if(thisnode.misc&NODE_NMSG)
+						getnmsg();
+					if(thisnode.misc&NODE_MSGW)
+						getsmsg(useron.number);
+					CRLF;
+					RESTORELINE; }
+				else
+					nodesync();
+				last=now;
+			}
+			gettimeleft();	// sets 'now'
+		}
 
 		if(!online || sys_status&SS_ABORT) {
 			sys_status&=~SS_ABORT;
 			CRLF;
-			break; }
+			break; 
+		}
 
 		switch(toupper(ch)) {
 			case 'T':   /* Telegram */
-- 
GitLab