From 935b5ac6522e20beeb27649574bba1c8cf4511fe Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 26 Jul 2023 13:32:45 +0300 Subject: ICQ: display outgoing file transfers as offline files, if a history is dowloaded from server --- protocols/ICQ-WIM/src/server.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 588cacaca1..8c58ed0c80 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -534,9 +534,10 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo } bool bIsOutgoing = it["outgoing"].as_bool(); + bool bIsChat = Contact::IsGroupChat(hContact); IcqFileInfo *pFileInfo = nullptr; - if (!bIsOutgoing && wszText.Left(26) == L"https://files.icq.net/get/") { + if (wszText.Left(26) == L"https://files.icq.net/get/") { if (!CheckFile(hContact, wszText, pFileInfo)) { debugLogA("Some shit happened, report this case to developers"); return; @@ -553,11 +554,11 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo CMStringA reqId(it["reqId"].as_mstring()); if (CheckOwnMessage(reqId, szMsgId, true)) { debugLogA("Skipping our own message %s", szMsgId.c_str()); - if (!Contact::IsGroupChat(hContact)) // prevent duplicates in private chats + if (!bIsChat) // prevent duplicates in private chats return; bIsOutgoing = bCreateRead = true; } - else if (Contact::IsGroupChat(hContact)) + else if (bIsChat) bCreateRead = true; // convert a file info into Miranda's file transfer @@ -579,6 +580,8 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo pre.lParam = (LPARAM)pFileInfo; if (bCreateRead) pre.dwFlags |= PRFF_READ; + if (bIsOutgoing) + pre.dwFlags |= PRFF_SENT; if (isChatRoom(hContact)) pre.szUserId = szSender; ProtoChainRecvFile(hContact, &pre); -- cgit v1.2.3