From 1b39bf8d3ef0d05ecde69f5162f420a444ca803e Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Mon, 19 Aug 2019 03:01:58 +0000
Subject: [PATCH] Fix issue where Share Avatar Collections imported from FTN
 were saved as files in data/fido with the node number encoded twice (once in
 hex and once in decimal): 006702c1.705.VERT.misc.bin

This is a harmless bug, but an unintentional one. It would also result in
unexpected filenames in text/avatars:
705.VERT.misc.bin

So... this commit should remove the "705." from these filenames.
---
 exec/avatars.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/exec/avatars.js b/exec/avatars.js
index 0d43f417df..f7fb3eef39 100644
--- a/exec/avatars.js
+++ b/exec/avatars.js
@@ -195,7 +195,9 @@ function import_shared_file(hdr, body)
 
 	// If the filename (in the subject) already contains the sender's QWK-ID, skip-it
 	var filename = file_getname(hdr.subject);
-	var prefix = file_getname(hdr.from_net_addr) + '.';
+	var prefix = '';
+	if(!fidoaddr.is_valid(hdr.from_net_addr))
+		prefix = file_getname(hdr.from_net_addr) + '.';
 	var suffix = '.bin';
 	if(filename.length > prefix.length + suffix.length
 		&& filename.substr(0, prefix.length).toLowerCase() == prefix.toLowerCase())
-- 
GitLab