summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-25 20:00:55 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-25 20:00:55 +0300
commit9ea18ddc413a8c1eae6c32fe16e162a1998079c1 (patch)
tree0fcf08adc603e6420fae94bf79d7ede357b96edb /include
parentc104e058686d3d36bc9b15d84bfd9b84740cd3fa (diff)
Telegram: offline files to be links from the very beginning
Diffstat (limited to 'include')
-rw-r--r--include/m_database.h3
-rw-r--r--include/m_protoint.h3
-rw-r--r--include/m_protosvc.h8
3 files changed, 13 insertions, 1 deletions
diff --git a/include/m_database.h b/include/m_database.h
index 42c787aa81..dd8afaca1a 100644
--- a/include/m_database.h
+++ b/include/m_database.h
@@ -721,6 +721,9 @@ namespace DB
bool isCompleted() const;
__forceinline bool isOffline() const { return m_szProtoString != nullptr; }
+
+ __forceinline void setUrl(const char *pszUrl) { m_szProtoString = mir_strdup(pszUrl); }
+ __forceinline void setSize(int64_t iSize) { m_iFileSize = iSize; }
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 07e461a118..83a4d8d523 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -266,6 +266,9 @@ public:
// called when the Account Manager needs to draw short account's options
virtual MWindow OnCreateAccMgrUI(MWindow hwndParent);
+ // called when an offline file is being created
+ virtual void OnCreateOfflineFile(DB::FILE_BLOB &blob, void *ft);
+
// called when an event is altered in database
virtual void OnEventDeleted(MCONTACT, MEVENT);
diff --git a/include/m_protosvc.h b/include/m_protosvc.h
index c9e6aacfc2..19bbad22f3 100644
--- a/include/m_protosvc.h
+++ b/include/m_protosvc.h
@@ -772,7 +772,6 @@ EXTERN_C MIR_APP_DLL(MEVENT) Proto_AuthRecv(const char *szProtoName, PROTORECVEV
#define PRFF_UTF 0x0002 // in all MAllCStrings .a contains text in UTF8
#define PRFF_SILENT 0x0004 // do not show file send/receive dialog
-
struct PROTORECVFILE
{
uint32_t dwFlags; // PRFF_*
@@ -796,6 +795,13 @@ __forceinline INT_PTR ProtoChainRecvFile(MCONTACT hContact, PROTORECVFILE *pre)
}
///////////////////////////////////////////////////////////////////////////////
+// Offline file's blob preparation
+// wParam = (DB::FILEBLOB*) blob to patch
+// lParam = (HANDLE) pointer to custom file transfer, passed to PROTORECVFILE.lParam
+
+#define PS_PRECREATE_OFFLINEFILE "/PreCreateOfflineFile"
+
+///////////////////////////////////////////////////////////////////////////////
// Offline file processing
#define PS_OFFLINEFILE "/OfflineFile"