From 010952c5c2dde278a024f6876e8189b949ea5dcf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jan 2024 15:44:57 +0300 Subject: the ancient atavism extincted: PROTORECVFILE structure with its own set of flags --- protocols/ICQ-WIM/src/server.cpp | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'protocols/ICQ-WIM/src') diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 7fd5181ea7..137be511a4 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -590,30 +590,22 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo // convert a file info into Miranda's file transfer if (pFileInfo) { - ptrW pwszFileName(mir_utf8decodeW(pFileInfo->szUrl)); - if (pwszFileName == nullptr) - pwszFileName = mir_a2u(pFileInfo->szUrl); + auto *p = strrchr(pFileInfo->szUrl, '/'); + auto *pszShortName = (p == nullptr) ? pFileInfo->szUrl.c_str() : p + 1; - const wchar_t *p = wcsrchr(pwszFileName, '/'); - const wchar_t *m_wszShortName = (p == nullptr) ? pwszFileName : p + 1; - - PROTORECVFILE pre = {}; - pre.dwFlags = PRFF_UNICODE | PRFF_SILENT; - pre.fileCount = 1; - pre.szId = szMsgId; - pre.timestamp = iMsgTime; - pre.files.w = &m_wszShortName; - pre.descr.w = pFileInfo->wszDescr; - pre.pUserInfo = pFileInfo; + DB::EventInfo dbei; + dbei.flags = DBEF_TEMPORARY; + dbei.szId = szMsgId; + dbei.timestamp = iMsgTime; if (bCreateRead) - pre.dwFlags |= PRFF_READ; + dbei.flags |= DBEF_READ; if (bIsOutgoing) - pre.dwFlags |= PRFF_SENT; + dbei.flags |= DBEF_SENT; if (!szReply.IsEmpty()) - pre.szReplyId = szReply; + dbei.szReplyId = szReply; if (isChatRoom(hContact)) - pre.szUserId = szSender; - ProtoChainRecvFile(hContact, &pre); + dbei.szUserId = szSender; + ProtoChainRecvFile(hContact, DB::FILE_BLOB(pFileInfo, pszShortName, T2Utf(pFileInfo->wszDescr)), dbei); return; } -- cgit v1.2.3