summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-07-20 21:25:40 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-07-20 21:25:44 +0300
commit4eba326a2e8356a02a03ecd3f07c773132a3bd0e (patch)
treeb9296783d5a6e2807708a86857788db894ef715e /protocols/ICQ-WIM/src/proto.cpp
parent507403f37d5418397d547045787753080d928faa (diff)
fixes #3579 (ICQ: устаревают ссылки на оффлайновые файлы)
Diffstat (limited to 'protocols/ICQ-WIM/src/proto.cpp')
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index a4b3207367..91db22a652 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -172,7 +172,7 @@ void CIcqProto::OnContactDeleted(MCONTACT hContact)
void CIcqProto::OnCreateOfflineFile(DB::FILE_BLOB &blob, void *hTransfer)
{
if (auto *pFileInfo = (IcqFileInfo *)hTransfer) {
- blob.setUrl(pFileInfo->szUrl);
+ blob.setUrl(pFileInfo->szOrigUrl);
blob.setSize(pFileInfo->dwFileSize);
}
}
@@ -216,12 +216,15 @@ void __cdecl CIcqProto::OfflineFileThread(void *pParam)
if (dbei && !strcmp(dbei.szModule, m_szModuleName) && dbei.eventType == EVENTTYPE_FILE) {
JSONNode root = JSONNode::parse((const char *)dbei.pBlob);
if (m_bOnline && root) {
- auto *pReq = new AsyncHttpRequest(CONN_NONE, REQUEST_GET, root["u"].as_string().c_str(), &CIcqProto::OnFileRecv);
- pReq->pUserInfo = ofd;
- pReq->AddHeader("Sec-Fetch-User", "?1");
- pReq->AddHeader("Sec-Fetch-Site", "cross-site");
- pReq->AddHeader("Sec-Fetch-Mode", "navigate");
- Push(pReq);
+ MCONTACT hContact = db_event_getContact(ofd->hDbEvent);
+ if (auto *pFileInfo = RetrieveFileInfo(hContact, fileText2url(root["u"].as_mstring()))) {
+ auto *pReq = new AsyncHttpRequest(CONN_NONE, REQUEST_GET, pFileInfo->szUrl, &CIcqProto::OnFileRecv);
+ pReq->pUserInfo = ofd;
+ pReq->AddHeader("Sec-Fetch-User", "?1");
+ pReq->AddHeader("Sec-Fetch-Site", "cross-site");
+ pReq->AddHeader("Sec-Fetch-Mode", "navigate");
+ Push(pReq);
+ }
return;
}
}