diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-25 13:01:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-25 13:01:04 +0300 |
commit | 1c83a98fd2de7a2d1f506da4ef4b058351315ca9 (patch) | |
tree | cdbe12e2e88b40be364bd295c059580b72a1903b | |
parent | b9a577d5769e8f93b1847f300c0d86af814f80d7 (diff) |
another atempt to make OS version understandable
-rw-r--r-- | plugins/PluginUpdater/src/Utils.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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 = {};
|