From 26686176cf3c08411c91dbb25f3973ab2a874722 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 29 Jul 2023 18:56:14 +0300 Subject: ICQ: remote file URL aesthetics --- protocols/ICQ-WIM/src/server.cpp | 5 +++++ protocols/ICQ-WIM/src/utils.cpp | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 8c58ed0c80..9fea03f48e 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -177,6 +177,11 @@ IcqFileInfo *CIcqProto::RetrieveFileInfo(MCONTACT hContact, const CMStringW &wsz bool CIcqProto::CheckFile(MCONTACT hContact, CMStringW &wszText, IcqFileInfo *&pFileInfo) { pFileInfo = nullptr; + + int idx = wszText.Find(' '); + if (idx != -1) + wszText.Truncate(idx); + CMStringW wszUrl(fileText2url(wszText)); // is it already downloaded sticker? diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp index fbe99c6ad6..ffaccc4747 100644 --- a/protocols/ICQ-WIM/src/utils.cpp +++ b/protocols/ICQ-WIM/src/utils.cpp @@ -247,11 +247,7 @@ void CIcqProto::setId(MCONTACT hContact, const char *szSetting, __int64 iValue) CMStringW fileText2url(const CMStringW &wszText) { - CMStringW wszUrl(wszText.Mid(26)); - int idx = wszUrl.Find(' '); - if (idx != -1) - wszUrl.Truncate(idx); - return wszUrl; + return wszText.Mid(26); } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3