summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_file.cpp11
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp17
-rw-r--r--protocols/JabberG/src/jabber_proto.h3
3 files changed, 11 insertions, 20 deletions
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index dc622efc31..410957bd45 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -95,7 +95,7 @@ void __cdecl CJabberProto::OfflineFileThread(OFDTHREAD *param)
if (written) {
DBVARIANT dbv = { DBVT_DWORD };
- dbv.dVal = written;
+ dbv.dVal = (DWORD)written;
db_event_setJson(param->hDbEvent, "ft", &dbv);
db_event_setJson(param->hDbEvent, "fs", &dbv);
NotifyEventHooks(g_hevEventEdited, 0, param->hDbEvent);
@@ -110,6 +110,15 @@ void __cdecl CJabberProto::OfflineFileThread(OFDTHREAD *param)
delete param;
}
+void CJabberProto::OnCreateOfflineFile(DB::FILE_BLOB &blob, void *pHandle)
+{
+ if (auto *ft = (filetransfer *)pHandle)
+ if (ft->type == FT_HTTP && ft->httpPath)
+ blob.setUrl(ft->httpPath);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
#define JABBER_NETWORK_BUFFER_SIZE 2048
void __cdecl CJabberProto::FileReceiveHttpThread(filetransfer *ft)
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 9faee94630..7eac9947c8 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -706,23 +706,6 @@ int CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/)
}
////////////////////////////////////////////////////////////////////////////////////////
-// RecvFile - writes down an incoming file transfer to db
-
-MEVENT CJabberProto::RecvFile(MCONTACT hContact, PROTORECVFILE *pre)
-{
- MEVENT hEvent = CSuper::RecvFile(hContact, pre);
- if (hEvent) {
- auto *ft = (filetransfer *)pre->lParam;
- if (ft && ft->type == FT_HTTP && ft->httpPath) {
- DBVARIANT dbv = { DBVT_UTF8 };
- dbv.pszVal = ft->httpPath;
- db_event_setJson(hEvent, "u", &dbv);
- }
- }
- return hEvent;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////
// SearchBasic - searches the contact by JID
struct JABBER_SEARCH_BASIC
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 52e8b98c91..15b9b0bff4 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -135,8 +135,6 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
HANDLE SearchAdvanced(HWND owner) override;
HWND CreateExtendedSearchUI(HWND owner) override;
- MEVENT RecvFile(MCONTACT hContact, PROTORECVFILE *pre) override;
-
int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
int SendMsg(MCONTACT hContact, int flags, const char *msg) override;
@@ -153,6 +151,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnBuildProtoMenu(void) override;
void OnContactDeleted(MCONTACT) override;
MWindow OnCreateAccMgrUI(MWindow) override;
+ void OnCreateOfflineFile(DB::FILE_BLOB &blob, void *pHandle);
void OnMarkRead(MCONTACT, MEVENT) override;
void OnModulesLoaded() override;
void OnShutdown() override;