summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-12 18:18:57 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-12 18:18:57 +0300
commit08840edfd4acce464d32244b5ccc3648588ce33d (patch)
tree61c799d10e287bf8ae1e293edee75ea5615328b2 /protocols
parentd0516970abbb1c4ae87ae31e360214b5e7e7763f (diff)
first attempt to make offline transfers visible
Diffstat (limited to 'protocols')
-rw-r--r--protocols/JabberG/src/jabber_file.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index 24ea2c6296..c96f6ae92c 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -46,19 +46,18 @@ void __cdecl CJabberProto::OfflineFileThread(OFDTHREAD *param)
// download the page
NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- if (nlhrReply) {
- if (nlhrReply->resultCode == 200) {
- FILE *f = _wfopen(param->wszPath, L"wb");
- fwrite(nlhrReply->pData, 1, nlhrReply->dataLength, f);
- fclose(f);
-
- blob.setSize(nlhrReply->dataLength);
- blob.write(dbei);
- db_event_edit(param->hDbEvent, &dbei);
-
- if (param->bOpen)
- ShellExecute(nullptr, L"open", param->wszPath, nullptr, nullptr, SW_SHOWDEFAULT);
- }
+ if (nlhrReply && nlhrReply->resultCode == 200) {
+ FILE *f = _wfopen(param->wszPath, L"wb");
+ fwrite(nlhrReply->pData, 1, nlhrReply->dataLength, f);
+ fclose(f);
+
+ DBVARIANT dbv = { DBVT_DWORD };
+ dbv.dVal = nlhrReply->dataLength;
+ db_event_setJson(param->hDbEvent, "ft", &dbv);
+ db_event_setJson(param->hDbEvent, "fs", &dbv);
+
+ if (param->bOpen)
+ ShellExecute(nullptr, L"open", param->wszPath, nullptr, nullptr, SW_SHOWDEFAULT);
}
}
}