From 85f4b96fc8bf9eb432e097825f8aa4db0426362b Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Fri, 7 Mar 2025 20:05:12 -0800
Subject: [PATCH] Add MSGS @-code - total messages in current sub-board

Unlike SMB_MSGS, the sub-board does not have to be already open.

As requested/reported by Finglonger (SILENT)
---
 src/sbbs3/atcodes.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/sbbs3/atcodes.cpp b/src/sbbs3/atcodes.cpp
index a12c65efc3..3d2f3e08db 100644
--- a/src/sbbs3/atcodes.cpp
+++ b/src/sbbs3/atcodes.cpp
@@ -815,6 +815,12 @@ const char* sbbs_t::atcode(const char* sp, char* str, size_t maxlen, int* pmode,
 	if (strcmp(sp, "GENDERS") == 0)
 		return cfg.new_genders;
 
+	if (strcmp(sp, "MSGS") == 0) {
+		int msgs = usrgrps ? getposts(&cfg, usrsub[curgrp][cursub[curgrp]]) : 0;
+		snprintf(str, maxlen, "%u",  msgs);
+		return str;
+	}
+
 	if (!strcmp(sp, "TMSG")) {
 		l = 0;
 		for (i = 0; i < cfg.total_subs; i++)
-- 
GitLab