summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-05-07 12:55:09 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-05-07 12:55:09 +0300
commit4ab93d52285bf072cea05ceac5333a1587c9980b (patch)
treef2a81f667f407a553eefed75a6490abe9b17a731
parent3cac3160302a2936d04c87c1f7f03fc400449778 (diff)
ME_DB_EVENT_SETJSON - separate event fired when only the JSON part of event is changed
-rw-r--r--include/m_database.h10
-rw-r--r--include/m_db_int.h1
-rw-r--r--libs/win32/mir_app.libbin293480 -> 293700 bytes
-rw-r--r--libs/win64/mir_app.libbin293248 -> 293458 bytes
-rw-r--r--plugins/Dbx_sqlite/src/dbevents.cpp2
-rw-r--r--plugins/NewStory/src/main.cpp1
-rw-r--r--src/mir_app/src/db_intf.cpp2
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
9 files changed, 17 insertions, 1 deletions
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
@@ -576,6 +576,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
// hook is not SAFE unless you know what you're doing with it, the arguments
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
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index ff294a6598..74daaab8d9 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files 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