From 59c69952e5a14de5e6a4e9d567aaaf0ce7685d86 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 6 Jun 2025 15:18:35 +0300 Subject: Telegram protocol not to use db_event_edit to update reactions, because it exports a message each time --- src/mir_app/src/MDatabaseCommon.cpp | 5 +++++ src/mir_app/src/mir_app.def | 1 + src/mir_app/src/mir_app64.def | 1 + src/mir_core/src/db.cpp | 10 +++++++++- src/mir_core/src/mir_core.def | 1 + src/mir_core/src/mir_core64.def | 1 + 6 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mir_app/src/MDatabaseCommon.cpp b/src/mir_app/src/MDatabaseCommon.cpp index 2d4d774455..c59d832629 100644 --- a/src/mir_app/src/MDatabaseCommon.cpp +++ b/src/mir_app/src/MDatabaseCommon.cpp @@ -553,6 +553,11 @@ STDMETHODIMP_(int) MDatabaseCommon::SetEventJson(MEVENT, const char *, DBVARIANT return 1; } +STDMETHODIMP_(int) MDatabaseCommon::SetEventJson(MEVENT, const char *) +{ + return 1; +} + ///////////////////////////////////////////////////////////////////////////////////////// // Resident settings diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index ef8f3858d5..d5916b76fa 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -1019,3 +1019,4 @@ Proto_CanDeleteHistory @1118 NONAME ?iHideTime@Clist@@3V?$CMOption@G@@A @1152 NONAME ?iAlpha@Clist@@3V?$CMOption@E@@A @1153 NONAME ?iAutoAlpha@Clist@@3V?$CMOption@E@@A @1154 NONAME +?SetEventJson@MDatabaseCommon@@UAGHIPBD@Z @1155 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index f69bb6e58d..8682876159 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -1019,3 +1019,4 @@ Proto_CanDeleteHistory @1118 NONAME ?iHideTime@Clist@@3V?$CMOption@G@@A @1152 NONAME ?iAlpha@Clist@@3V?$CMOption@E@@A @1153 NONAME ?iAutoAlpha@Clist@@3V?$CMOption@E@@A @1154 NONAME +?SetEventJson@MDatabaseCommon@@UEAAHIPEBD@Z @1155 NONAME diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index e2b67aa4b5..5a6811ab82 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -531,6 +531,14 @@ 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_setJson(MEVENT hDbEvent, const char *pBlob) +{ + if (g_pCurrDb == nullptr) + return 1; + + return g_pCurrDb->SetEventJson(hDbEvent, pBlob); +} + MIR_CORE_DLL(int) db_event_setJson(MEVENT hDbEvent, const char *szSetting, DBVARIANT *dbv) { if (g_pCurrDb == nullptr) @@ -565,7 +573,7 @@ MIR_CORE_DLL(int) db_event_setJson(MEVENT hDbEvent, const char *szSetting, DBVAR } dbei.flushJson(); - return db_event_edit(hDbEvent, &dbei); + return g_pCurrDb->SetEventJson(hDbEvent, dbei.pBlob); } MIR_CORE_DLL(int) db_event_updateId(MEVENT hDbEvent, const char *szId) diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 4061511fb0..2c91438bee 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1588,3 +1588,4 @@ _db_event_delivered@8 @1806 NONAME ??6MBinBuffer@@QAEAAV0@I@Z @1813 NONAME ??6MBinBuffer@@QAEAAV0@_K@Z @1814 NONAME _Utils_IsoToUnixTime@4 @1815 NONAME +?db_event_setJson@@YGHIPBD@Z @1816 NONAME diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 16e49f90b4..2f83d9c0b0 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1588,3 +1588,4 @@ db_event_delivered @1806 NONAME ??6MBinBuffer@@QEAAAEAV0@I@Z @1813 NONAME ??6MBinBuffer@@QEAAAEAV0@_K@Z @1814 NONAME Utils_IsoToUnixTime @1815 NONAME +?db_event_setJson@@YAHIPEBD@Z @1816 NONAME -- cgit v1.2.3