From 1c83a98fd2de7a2d1f506da4ef4b058351315ca9 Mon Sep 17 00:00:00 2001
From: George Hazan <ghazan@miranda.im>
Date: Mon, 25 Mar 2019 13:01:04 +0300
Subject: another atempt to make OS version understandable

---
 plugins/PluginUpdater/src/Utils.cpp | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

(limited to 'plugins')

diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp
index 6add34f2f7..253bc2151c 100644
--- a/plugins/PluginUpdater/src/Utils.cpp
+++ b/plugins/PluginUpdater/src/Utils.cpp
@@ -224,16 +224,15 @@ bool DownloadFile(FILEURL *pFileURL, HNETLIBCONN &nlc)
 	Miranda_GetVersionText(szMirVer, _countof(szMirVer));
 	if (auto *p = strchr(szMirVer, '('))
 		*p = 0;
+	rtrim(szMirVer);
 
-	wchar_t wszOsVer[100];
-	GetOSDisplayString(wszOsVer, _countof(wszOsVer));
-	if (auto *p = wcschr(wszOsVer, '('))
-		*p = 0;
-
-	CMStringA szUserAgent("Miranda ");
+	int osVer = LOWORD(GetVersion());
+	CMStringA szUserAgent("Miranda NG/");
 	szUserAgent.Append(szMirVer);
-	szUserAgent.Append(" (");
-	szUserAgent.Append(_T2A(wszOsVer));
+	szUserAgent.AppendFormat(" (Windows NT %d.%d", LOBYTE(osVer), HIBYTE(osVer));
+	#ifdef _WIN64
+		szUserAgent.Append("; Win64; x64");
+	#endif
 	szUserAgent.Append(")");
 
 	NETLIBHTTPREQUEST nlhr = {};
-- 
cgit v1.2.3