From e00f739f3c8cffa72d262cbd32729fbedc69cf10 Mon Sep 17 00:00:00 2001
From: Rob Swindell <rob@synchro.net>
Date: Tue, 22 Feb 2022 13:10:17 -0800
Subject: [PATCH] Fix network user/address look-up (using qnet/users.dat)

The QWKnet user look-up feature was broken as of commit e4fc5d04d9c6570e31e (a year ago).

Just noticed this regression as Andre asked in IRC about looking up network users for netmail. This feature worked for QWKnet users/addresses, at least, and now will work again.
---
 src/sbbs3/netmail.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sbbs3/netmail.cpp b/src/sbbs3/netmail.cpp
index 095c7bf26e..042f4816ea 100644
--- a/src/sbbs3/netmail.cpp
+++ b/src/sbbs3/netmail.cpp
@@ -105,11 +105,13 @@ bool sbbs_t::netmail(const char *into, const char *title, long mode, smb_t* resm
 		}
 	}
 
+	if(*to == '\0' && cc_list != NULL && (*cc_list) != NULL) {
+		SAFECOPY(to, cc_list[0]);
+		cc_list++;
+	}
 	lookup_netuser(to);
 
 	net_addr = to;
-	if(*net_addr == '\0' && cc_list != NULL)
-		net_addr = cc_list[0];
 	net_type = smb_netaddr_type(net_addr);
 
 	lprintf(LOG_DEBUG, "parsed net type of '%s' is %s", net_addr, smb_nettype((enum smb_net_type)net_type));
-- 
GitLab