diff options
author | George Hazan <george.hazan@gmail.com> | 2024-06-06 16:18:43 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-06-06 16:18:43 +0300 |
commit | 5b70baa32617190d97f36e389c11140d389e093c (patch) | |
tree | 5e1ecfd6b577b0d6c49fe91e260076b65197d720 /protocols/ICQ-WIM/src/utils.cpp | |
parent | cf9398bf479f55b792fc932f1fdadfe7d1deb3c3 (diff) |
fixes #4449 (ICQ: broken cloud file download)
Diffstat (limited to 'protocols/ICQ-WIM/src/utils.cpp')
-rw-r--r-- | protocols/ICQ-WIM/src/utils.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp index 2c36c3fb86..460e20ff2f 100644 --- a/protocols/ICQ-WIM/src/utils.cpp +++ b/protocols/ICQ-WIM/src/utils.cpp @@ -266,26 +266,29 @@ void CIcqProto::setId(MCONTACT hContact, const char *szSetting, __int64 iValue) /////////////////////////////////////////////////////////////////////////////////////////
-bool fileText2url(const CMStringW &wszText, CMStringW *res)
+int fileText2url(const CMStringW &wszText, CMStringW *res)
{
+ int iStart = 0;
if (!mir_wstrncmp(wszText, L"https://files.icq.net/get/", 26)) {
if (res)
- *res = wszText.Mid(26);
+ *res = wszText.Mid(iStart = 26);
}
else if (!mir_wstrncmp(wszText, L"http://files.icq.net/get/", 25)) {
if (res)
- *res = wszText.Mid(25);
- return true;
+ *res = wszText.Mid(iStart = 25);
}
- else return false;
+ else return 0;
if (res) {
int idx = res->FindOneOf(L" \r\n\t");
- if (idx != -1)
- *res = res->Mid(0, idx);
+ if (idx == -1)
+ return -1;
+
+ *res = res->Mid(0, idx);
+ return iStart + idx;
}
- return true;
+ return 1;
}
/////////////////////////////////////////////////////////////////////////////////////////
|