From 4ab93d52285bf072cea05ceac5333a1587c9980b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 7 May 2024 12:55:09 +0300 Subject: ME_DB_EVENT_SETJSON - separate event fired when only the JSON part of event is changed --- include/m_database.h | 10 ++++++++++ include/m_db_int.h | 1 + libs/win32/mir_app.lib | Bin 293480 -> 293700 bytes libs/win64/mir_app.lib | Bin 293248 -> 293458 bytes plugins/Dbx_sqlite/src/dbevents.cpp | 2 +- plugins/NewStory/src/main.cpp | 1 + src/mir_app/src/db_intf.cpp | 2 ++ src/mir_app/src/mir_app.def | 1 + src/mir_app/src/mir_app64.def | 1 + 9 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/m_database.h b/include/m_database.h index 5dd0a2859a..03e035623d 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -575,6 +575,16 @@ EXTERN_C MIR_APP_DLL(HICON) DbEvent_GetIcon(DBEVENTINFO *dbei, int flags); #define ME_DB_EVENT_EDITED "DB/Event/Edited" +///////////////////////////////////////////////////////////////////////////////////////// +// DB/Event/SetJson event +// Called when the JSON part of an existing event was changed +// wParam = (MCONTACT)hContact +// lParam = (LPARAM)(HANDLE)hDbEvent +// hDbEvent is a valid handle to the event. hContact is a valid handle to the +// contact to which hDbEvent refers. + +#define ME_DB_EVENT_SETJSON "DB/Event/SetJson" + ///////////////////////////////////////////////////////////////////////////////////////// // DB/Event/FilterAdd (NOTE: Added during 0.3.3+ development!) // Called **before** a new event is made of a DBEVENTINFO structure, this diff --git a/include/m_db_int.h b/include/m_db_int.h index 51f494049a..75302a945c 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -384,6 +384,7 @@ EXTERN_C MIR_APP_EXPORT HANDLE g_hevEventAdded, // ME_DB_EVENT_ADDED g_hevEventEdited, // ME_DB_EVENT_EDITED g_hevEventDeleted, // ME_DB_EVENT_DELETED + g_hevEventSetJson, // ME_DB_EVENT_SETJSON g_hevEventDelivered, // ME_DB_EVENT_DELIVERED g_hevEventFiltered; // ME_DB_EVENT_FILTER_ADD diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index d1b394d98d..0dfc6e097a 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib index ff294a6598..74daaab8d9 100644 Binary files a/libs/win64/mir_app.lib and b/libs/win64/mir_app.lib differ diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index 0d41744ba3..38a3546098 100644 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -378,7 +378,7 @@ int CDbxSQLite::SetEventJson(MEVENT hDbEvent, const char *szSetting, DBVARIANT * if (cc->IsSub()) hContact = cc->parentID; - NotifyEventHooks(g_hevEventEdited, hContact, hDbEvent); + NotifyEventHooks(g_hevEventSetJson, hContact, hDbEvent); } return 0; } diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index a74019cffb..705dcccdb5 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -195,6 +195,7 @@ int CMPlugin::Load() HookEvent(ME_DB_EVENT_ADDED, evtEventAdded); HookEvent(ME_DB_EVENT_DELETED, evtEventDeleted); HookEvent(ME_DB_EVENT_EDITED, evtEventEdited); + HookEvent(ME_DB_EVENT_SETJSON, evtEventEdited); HookEvent(ME_OPT_INITIALISE, OptionsInitialize); HookEvent(ME_SYSTEM_MODULESLOADED, evtModulesLoaded); HookEvent(ME_SYSTEM_PRESHUTDOWN, evtPreShutdown); diff --git a/src/mir_app/src/db_intf.cpp b/src/mir_app/src/db_intf.cpp index f3b445a4fa..082eea3fe6 100644 --- a/src/mir_app/src/db_intf.cpp +++ b/src/mir_app/src/db_intf.cpp @@ -71,6 +71,7 @@ MIR_APP_EXPORT HANDLE g_hevMarkedRead, // ME_DB_EVENT_MARKED_READ g_hevEventAdded, // ME_DB_EVENT_ADDED g_hevEventEdited, // ME_DB_EVENT_EDITED + g_hevEventSetJson, // ME_DB_EVENT_SETJSON g_hevEventDeleted, // ME_DB_EVENT_DELETED g_hevEventDelivered, // ME_DB_EVENT_DELIVERED g_hevEventFiltered; @@ -86,6 +87,7 @@ int LoadDbintfModule() g_hevEventAdded = CreateHookableEvent(ME_DB_EVENT_ADDED); g_hevEventEdited = CreateHookableEvent(ME_DB_EVENT_EDITED); g_hevEventDeleted = CreateHookableEvent(ME_DB_EVENT_DELETED); + g_hevEventSetJson = CreateHookableEvent(ME_DB_EVENT_SETJSON); g_hevEventDelivered = CreateHookableEvent(ME_DB_EVENT_DELIVERED); g_hevEventFiltered = CreateHookableEvent(ME_DB_EVENT_FILTER_ADD); diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index d557bce2dd..33fdcbda22 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -970,3 +970,4 @@ _Netlib_DownloadFile@20 @1099 NONAME ?getEvent@EventInfo@DB@@QBEIXZ @1106 NONAME ?GetPreviewPath@PROTO_INTERFACE@@QBE?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@XZ @1107 NONAME g_hevEventDelivered @1108 NONAME +g_hevEventSetJson @1109 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 575e6f63f0..567e6bc7c0 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -970,3 +970,4 @@ Netlib_DownloadFile @1093 NONAME ?getEvent@EventInfo@DB@@QEBAIXZ @1100 NONAME ?GetPreviewPath@PROTO_INTERFACE@@QEBA?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@XZ @1101 NONAME g_hevEventDelivered @1102 NONAME +g_hevEventSetJson @1103 NONAME -- cgit v1.2.3