From 77ea5b95cd68a295068394e9d0c505f0b26221ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 19 Sep 2018 15:34:32 +0300 Subject: GetEventById & SetEventId - two new methods to operate with events by their server ids --- include/m_database.h | 12 ++++++++++++ include/m_db_int.h | 7 +++++++ 2 files changed, 19 insertions(+) (limited to 'include') diff --git a/include/m_database.h b/include/m_database.h index c67ee25475..8edb101dff 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -392,6 +392,18 @@ Events in a chain are sorted chronologically automatically EXTERN_C MIR_CORE_DLL(MEVENT) db_event_prev(MCONTACT hContact, MEVENT hDbEvent); +/* +Retrieves a handle to the event identified by its module and unique identifier +*/ + +EXTERN_C MIR_CORE_DLL(MEVENT) db_event_getById(const char *szModule, const char *szId); + +/* +Sets an identifier for an event identified by its module and handle +*/ + +EXTERN_C MIR_CORE_DLL(MEVENT) db_event_setId(const char *szModule, MEVENT hDbEvent, const char *szId); + ///////////////////////////////////////////////////////////////////////////////////////// // Database settings diff --git a/include/m_db_int.h b/include/m_db_int.h index 50b8279e23..3c07534ced 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -128,6 +128,9 @@ interface MIR_APP_EXPORT MIDatabase STDMETHOD_(BOOL, Compact)(void) PURE; STDMETHOD_(BOOL, Backup)(LPCWSTR) PURE; + + STDMETHOD_(MEVENT, GetEventById)(LPCSTR szModule, LPCSTR szId) PURE; + STDMETHOD_(BOOL, SetEventId)(LPCSTR szModule, MEVENT, LPCSTR szId) PURE; }; ///////////////////////////////////////////////////////////////////////////////////////// @@ -219,6 +222,10 @@ public: //////////////////////////////////////////////////////////////////////////////////////// STDMETHODIMP_(BOOL) MetaMergeHistory(DBCachedContact*, DBCachedContact*) override; STDMETHODIMP_(BOOL) MetaSplitHistory(DBCachedContact*, DBCachedContact*) override; + + //////////////////////////////////////////////////////////////////////////////////////// + STDMETHODIMP_(MEVENT) GetEventById(LPCSTR szModule, LPCSTR szId) override; + STDMETHODIMP_(BOOL) SetEventId(LPCSTR szModule, MEVENT, LPCSTR szId) override; }; ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3