summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-11 22:03:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-11 22:03:29 +0300
commitcd83b1c10bbe50f5aa43a8e8f7dffc5fee1d769a (patch)
treeffbe1ab12d4f89ecbf6b909efe1a1ac7669efc15 /protocols/JabberG/src/jabber_proto.cpp
parent805a76745801f9ac14a837e45ef50b9206ac54da (diff)
DB::FILE_BLOB expansion for the offline file transfers, part I
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 9891bfd60f..acc141e114 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -188,6 +188,9 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) :
// XEP-0224 support (Attention/Nudge)
CreateProtoService(PS_SEND_NUDGE, &CJabberProto::JabberSendNudge);
+ // Offline file transfer
+ CreateProtoService(PS_OFFLINEFILE, &CJabberProto::OnOfflineFile);
+
// service to get from protocol chat buddy info
CreateProtoService(MS_GC_PROTO_GETTOOLTIPTEXT, &CJabberProto::JabberGCGetToolTipText);
@@ -809,6 +812,20 @@ HANDLE CJabberProto::SearchByName(const wchar_t *nick, const wchar_t *firstName,
return (HANDLE)pInfo->GetIqId();
}
+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;
+}
+
////////////////////////////////////////////////////////////////////////////////////////
// SendContacts