From c508455f0e1d9071ec54e193323f5288e38b999d Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Mon, 26 Aug 2002 21:50:48 +0000
Subject: [PATCH] Created new sub_t misc bit, SUB_NOUSERSIG to disable user
 signatures.

---
 src/sbbs3/sbbsdefs.h   |  1 +
 src/sbbs3/writemsg.cpp | 22 ++++++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/sbbs3/sbbsdefs.h b/src/sbbs3/sbbsdefs.h
index c5ddc178ed..0761e57957 100644
--- a/src/sbbs3/sbbsdefs.h
+++ b/src/sbbs3/sbbsdefs.h
@@ -264,6 +264,7 @@
 #define SUB_HYPER		(1L<<27)	/* Hyper allocation */
 #define SUB_EDIT		(1L<<28)	/* Users can edit message text after posting */
 #define SUB_EDITLAST	(1L<<29)	/* Users can edit last message only */
+#define SUB_NOUSERSIG	(1L<<30)	/* Suppress user signatures */
 #define SUB_HDRMOD		(1L<<31)	/* Modified sub-board header info (SCFG) */
 
                                     /* Bit values for dir[x].misc */
diff --git a/src/sbbs3/writemsg.cpp b/src/sbbs3/writemsg.cpp
index ab25e2675d..678fb305da 100644
--- a/src/sbbs3/writemsg.cpp
+++ b/src/sbbs3/writemsg.cpp
@@ -404,17 +404,19 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
 		bputs(text[NoMoreLines]);
 
 	/* Signature file */
-	sprintf(str,"%suser/%04u.sig",cfg.data_dir,useron.number);
-	FILE* sig;
-	if(!(mode&WM_EXTDESC) && fexist(str) && (sig=fopen(str,"rb"))!=NULL) {
-		while(!feof(sig)) {
-			if(!fgets(str,sizeof(str)-1,sig))
-				break;
-			fputs(str,stream);
-			l+=strlen(str);	/* byte counter */
-			i++;			/* line counter */
+	if(subnum==INVALID_SUB || !(cfg.sub[subnum]->misc&SUB_NOUSERSIG)) {
+		sprintf(str,"%suser/%04u.sig",cfg.data_dir,useron.number);
+		FILE* sig;
+		if(fexist(str) && (sig=fopen(str,"rb"))!=NULL) {
+			while(!feof(sig)) {
+				if(!fgets(str,sizeof(str)-1,sig))
+					break;
+				fputs(str,stream);
+				l+=strlen(str);	/* byte counter */
+				i++;			/* line counter */
+			}
+			fclose(sig);
 		}
-		fclose(sig);
 	}
 
 	fclose(stream);
-- 
GitLab