From 1ce38717d8bd1fe9d6d273151a4aebbbe5bbbe25 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 16 Nov 2017 20:50:06 +0000
Subject: [PATCH] Add a syspage.* semfile polling feature/popup for Nigel. Also
 fixed the exit menu for long screen (not saving/restoring the bg).

---
 src/sbbs3/umonitor/umonitor.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/sbbs3/umonitor/umonitor.c b/src/sbbs3/umonitor/umonitor.c
index a8d072ae40..9e2ea012a4 100644
--- a/src/sbbs3/umonitor/umonitor.c
+++ b/src/sbbs3/umonitor/umonitor.c
@@ -795,6 +795,7 @@ int main(int argc, char** argv)  {
 	scfg_t	cfg;
 	int		done;
 	int		ciolib_mode=CIOLIB_MODE_AUTO;
+	time_t	last_semfile_check = time(NULL);
 
 	/******************/
 	/* Ini file stuff */
@@ -994,12 +995,27 @@ int main(int argc, char** argv)  {
 
 		drawstats(&cfg, main_dflt, &node, &main_dflt, &main_bar);
 
+		if(time(NULL) - last_semfile_check > bbs_startup.sem_chk_freq * 2) {
+			SAFEPRINTF(str, "%ssyspage.*", cfg.ctrl_dir);
+			if(fexistcase(str)) {
+				putch(BEL);
+				char msg[128];
+				SAFEPRINTF(msg, "Node %s is paging you to chat", getfext(str) + 1);
+				uifc.pop(msg);
+				SLEEP(1500);
+				uifc.pop(NULL);
+			}
+			last_semfile_check = time(NULL);
+		}
+
 		j=uifc.list(WIN_L2R|WIN_ESC|WIN_ACT|WIN_DYN,0,5,70,&main_dflt,&main_bar
 			,title,mopt);
 
 		if(j == -2)
 			continue;
 
+		last_semfile_check = time(NULL);
+
 		if(j==-7) {	/* CTRL-E */
 			sprintf(str,"%s/error.log",cfg.data_dir);
 			view_log(str,"Error Log");
@@ -1100,7 +1116,7 @@ int main(int argc, char** argv)  {
 							"\n"
 							"\nIf you want to exit the Synchronet UNIX monitor utility,"
 							"\nselect `Yes`. Otherwise, select `No` or hit ~ ESC ~.";
-			i=uifc.list(WIN_MID,0,0,0,&i,0,"Exit Synchronet Monitor",opt);
+			i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0,"Exit Synchronet Monitor",opt);
 			if(!i)
 				bail(0);
 			continue;
-- 
GitLab