From 7c8f73f1ea8f9cf572de8cb8a8a65651ffe2bbbe Mon Sep 17 00:00:00 2001
From: "Rob Swindell (in GitKraken)" <rob@synchro.net>
Date: Fri, 10 Mar 2023 19:17:53 -0800
Subject: [PATCH] Introduce sbbs_t::sync() method that does what the old
 SYNC/ASYNC macros do

But... as rightful member of sbbs_t, thus useful from other scopes.

Should get rid of all use of SYNC/ASYNC now then.
---
 src/sbbs3/js_bbs.cpp | 1 +
 src/sbbs3/sbbs.h     | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/sbbs3/js_bbs.cpp b/src/sbbs3/js_bbs.cpp
index dbad44a6c4..0d87a18b26 100644
--- a/src/sbbs3/js_bbs.cpp
+++ b/src/sbbs3/js_bbs.cpp
@@ -1951,6 +1951,7 @@ js_logoff(JSContext *cx, uintN argc, jsval *arglist)
 			sbbs->exec_bin(sbbs->cfg.logoff_mod,&sbbs->main_csi);
 		sbbs->user_event(EVENT_LOGOFF);
 		sbbs->menu("logoff");
+		sbbs->sync();
 		sbbs->hangup();
 	}
 	JS_RESUMEREQUEST(cx, rc);
diff --git a/src/sbbs3/sbbs.h b/src/sbbs3/sbbs.h
index 8df1d33e95..d3a35819a9 100644
--- a/src/sbbs3/sbbs.h
+++ b/src/sbbs3/sbbs.h
@@ -966,6 +966,7 @@ public:
 	user_t	nodesync_user{};
 	bool	nodesync_inside = false;
 	uint	count_nodes(bool self = true);
+	void	sync(bool clearline = false) { getnodedat(cfg.node_num, &thisnode, 0); nodesync(clearline); }
 
 	/* putnode.cpp */
 	int		putnodedat(uint number, node_t * node);
-- 
GitLab