From 4a824f52e48c220a23d0260818dfd61e104161fa Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Thu, 10 Dec 2020 01:33:14 -0800
Subject: [PATCH] Display message comment headers without relying on
 smb_getmsgtxt()

Since we're calling smb_getplaintext() manually here, and its not going to return the comment headers as part of the plain-text (the way smb_getmsgtxt() can), so we need to display find/display the comment headers first.
---
 src/sbbs3/getmsg.cpp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/sbbs3/getmsg.cpp b/src/sbbs3/getmsg.cpp
index 05c00703c6..d0c98915b5 100644
--- a/src/sbbs3/getmsg.cpp
+++ b/src/sbbs3/getmsg.cpp
@@ -272,19 +272,19 @@ bool sbbs_t::show_msg(smb_t* smb, smbmsg_t* msg, long p_mode, post_t* post)
 
 	show_msghdr(smb, msg);
 
+	int comments=0;
+	for(int i = 0; i < msg->total_hfields; i++)
+		if(msg->hfield[i].type == SMB_COMMENT) {
+			bprintf("%s\r\n", (char*)msg->hfield_dat[i]);
+			comments++;
+		}
+	if(comments)
+		CRLF;
+
 	if(msg->hdr.type == SMB_MSG_TYPE_POLL && post != NULL && smb->subnum < cfg.total_subs) {
 		char* answer;
 		int longest_answer = 0;
 
-		int comments=0;
-		for(int i = 0; i < msg->total_hfields; i++)
-			if(msg->hfield[i].type == SMB_COMMENT) {
-				bprintf("%s\r\n", (char*)msg->hfield_dat[i]);
-				comments++;
-			}
-		if(comments)
-			CRLF;
-
 		for(int i = 0; i < msg->total_hfields; i++) {
 			if(msg->hfield[i].type != SMB_POLL_ANSWER)
 				continue;
@@ -332,7 +332,7 @@ bool sbbs_t::show_msg(smb_t* smb, smbmsg_t* msg, long p_mode, post_t* post)
 			mnemonics(text[VoteInThisPollNow]);
 		return true;
 	}
-	if((txt=smb_getmsgtxt(smb, msg, 0)) == NULL)
+	if((txt=smb_getmsgtxt(smb, msg, GETMSGTXT_BODY_ONLY)) == NULL)
 		return false;
 	char* p = txt;
 	if(!(console&CON_RAW_IN)) {
-- 
GitLab