diff options
author | George Hazan <george.hazan@gmail.com> | 2024-06-21 18:11:30 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-06-21 18:11:30 +0300 |
commit | c4c9a256d3f99f22671214a7377a439d2bf68df3 (patch) | |
tree | df6141d9de704bb9e180c4a11597bd90ed6cf8ac /protocols/ICQ-WIM | |
parent | 92d3ebecee03d7c97dd44a5ab3dd3938dff9088e (diff) |
ICQ: fix for cyrillic file names in history
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index f1df35bbb2..9f00af8f2a 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -601,8 +601,12 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo // convert a file info into Miranda's file transfer
if (pFileInfo) {
- auto *p = strrchr(pFileInfo->szUrl, '/');
- auto *pszShortName = (p == nullptr) ? pFileInfo->szUrl.c_str() : p + 1;
+ auto *pszShortName = pFileInfo->szUrl.c_str();
+ int slashPos = pFileInfo->szUrl.ReverseFind('/');
+ if (slashPos != -1) {
+ slashPos++;
+ pszShortName += slashPos;
+ }
DB::EventInfo dbei(hEvent);
dbei.eventType = EVENTTYPE_FILE;
@@ -640,7 +644,10 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo if (rc != 0 || st.st_size != iSaveSize) {
MHttpRequest nlhr(REQUEST_GET);
nlhr.flags = NLHRF_REDIRECT;
- nlhr.m_szUrl = mir_urlEncode(szUrl);
+ if (slashPos == -1)
+ nlhr.m_szUrl = mir_urlEncode(szUrl);
+ else
+ nlhr.m_szUrl = szUrl.Mid(0, slashPos) + mir_urlEncode(szUrl.Mid(slashPos));
nlhr.AddHeader("Sec-Fetch-User", "?1");
nlhr.AddHeader("Sec-Fetch-Site", "cross-site");
nlhr.AddHeader("Sec-Fetch-Mode", "navigate");
|