From 531115e5957eaf35e9f843754dcd30b6a57ef1a5 Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Tue, 20 Apr 2021 22:04:10 -0700
Subject: [PATCH] Don't log an error when a QWKnet node uploads votes for old
 messages

Log an info-level message instead.
Raise the log level severity of duplicate votes from Debug to Info too.
---
 src/sbbs3/qwk.cpp | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/sbbs3/qwk.cpp b/src/sbbs3/qwk.cpp
index f3c3f31fbc..5e4770d0f9 100644
--- a/src/sbbs3/qwk.cpp
+++ b/src/sbbs3/qwk.cpp
@@ -1135,15 +1135,16 @@ bool sbbs_t::qwk_vote(str_list_t ini, const char* section, smb_net_type_t net_ty
 			notice = text[PollVoteNotice];
 		}
 		result = votemsg(&cfg, &smb, &msg, notice, text[VoteNoticeFmt]);
-		if(result == SMB_DUPE_MSG)
-			lprintf(LOG_DEBUG, "Duplicate vote-msg (%s) from %s", msg.id, qnet_id);
+		if(result == SMB_DUPE_MSG) {
+			lprintf(LOG_INFO, "Duplicate vote-msg (%s) from %s", msg.id, qnet_id);
+		}
+		else if(result == SMB_ERR_HDR_FIELD) {
+			lprintf(LOG_INFO, "Error %s (%d) writing %s vote-msg (%s) to %s"
+				,smb.last_error, result, qnet_id, msg.id, smb.file);
+			result = SMB_SUCCESS; // ignore vote failures for old messages
+		}
 		else if(result != SMB_SUCCESS) {
-			if(hubnum >= 0) {
-				lprintf(LOG_DEBUG, "Error %s (%d) writing %s vote-msg (%s) to %s"
-					,smb.last_error, result, qnet_id, msg.id, smb.file);
-				result = SMB_SUCCESS; // ignore vote failures for old messages
-			} else
-				errormsg(WHERE, ERR_WRITE, smb.file, result, smb.last_error);
+			errormsg(WHERE, ERR_WRITE, smb.file, result, smb.last_error);
 		}
 	}
 	else if(strnicmp(section, "close:", 6) == 0) {
-- 
GitLab