From ee8c388aef77da6d8a7ea900cfba8661faefb30b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 5 Jan 2023 15:24:07 +0300 Subject: new database functions for Telegram --- src/mir_app/src/MDatabaseReadonly.cpp | 5 +++++ src/mir_app/src/mir_app.def | 1 + src/mir_app/src/mir_app64.def | 1 + src/mir_core/src/db.cpp | 7 +++++++ src/mir_core/src/mir_core.def | 1 + src/mir_core/src/mir_core64.def | 1 + 6 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/mir_app/src/MDatabaseReadonly.cpp b/src/mir_app/src/MDatabaseReadonly.cpp index f022d5e5fb..c386c4d6f4 100644 --- a/src/mir_app/src/MDatabaseReadonly.cpp +++ b/src/mir_app/src/MDatabaseReadonly.cpp @@ -178,3 +178,8 @@ MEVENT MDatabaseReadonly::GetEventById(LPCSTR, LPCSTR) { return 0; } + +int MDatabaseReadonly::UpdateEventId(MEVENT, LPCSTR) +{ + return 1; +} diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 37f37cec9d..726bcbc22b 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -809,3 +809,4 @@ Srmm_CreateHotkey @886 NONAME ?bTopicOnClist@Chat@@3V?$CMOption@_N@@A @910 NONAME ?getBlob@PROTO_INTERFACE@@QAE?AVMBinBuffer@@IPBD@Z @911 NONAME ?getBlob@PROTO_INTERFACE@@QAE?AVMBinBuffer@@PBD@Z @912 NONAME +?UpdateEventId@MDatabaseReadonly@@UAGHIPBD@Z @913 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 9f94234c59..5271b8f291 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -809,3 +809,4 @@ Srmm_CreateHotkey @886 NONAME ?bTopicOnClist@Chat@@3V?$CMOption@_N@@A @910 NONAME ?getBlob@PROTO_INTERFACE@@QEAA?AVMBinBuffer@@IPEBD@Z @911 NONAME ?getBlob@PROTO_INTERFACE@@QEAA?AVMBinBuffer@@PEBD@Z @912 NONAME +?UpdateEventId@MDatabaseReadonly@@UEAAHIPEBD@Z @913 NONAME diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 362d359f17..5414dac6cb 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -458,6 +458,8 @@ MIR_CORE_DLL(MEVENT) db_event_replace(MCONTACT hContact, const DBEVENTINFO *dbei ret = db_event_getById(dbei->szModule, dbei->szId); if (!ret) ret = db_event_add(hContact, dbei); + else + db_event_edit(hContact, ret, dbei); return ret; } @@ -466,6 +468,11 @@ MIR_CORE_DLL(MEVENT) db_event_getById(const char *szModule, const char *szId) return (g_pCurrDb == nullptr) ? 0 : g_pCurrDb->GetEventById(szModule, szId); } +MIR_CORE_DLL(int) db_event_updateId(MEVENT hDbEvent, const char *szId) +{ + return (g_pCurrDb == nullptr) ? 0 : g_pCurrDb->UpdateEventId(hDbEvent, szId); +} + ///////////////////////////////////////////////////////////////////////////////////////// // event cursors diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 09e1804cc4..a2b489708e 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1548,3 +1548,4 @@ _Utils_CorrectFontSize@4 @1762 NONAME ?append@MBinBuffer@@QAEXABV1@@Z @1769 NONAME ?appendBefore@MBinBuffer@@QAEXABV1@@Z @1770 NONAME db_event_replace @1771 +db_event_updateId @1772 diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 9862559f69..07b98136f8 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1548,3 +1548,4 @@ Utils_CorrectFontSize @1762 NONAME ?append@MBinBuffer@@QEAAXAEBV1@@Z @1769 NONAME ?appendBefore@MBinBuffer@@QEAAXAEBV1@@Z @1770 NONAME db_event_replace @1771 +db_event_updateId @1772 -- cgit v1.2.3