summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-04-17 20:00:05 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-04-17 20:00:05 +0300
commit366b12a36bf052025bce085d2859486e0318231c (patch)
tree7f6aee056041cd2892ed120a74aacc8206969351 /src
parent59a8c98ac4f4b208a27eed43cc860c8e5a9c799b (diff)
db_event_delivered + ME_DB_EVENT_DELIVERED = helper & hookable event to catch event's delivery to a server
Diffstat (limited to 'src')
-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
-rw-r--r--src/mir_core/src/db.cpp6
-rw-r--r--src/mir_core/src/mir_core.def7
-rw-r--r--src/mir_core/src/mir_core64.def7
6 files changed, 18 insertions, 6 deletions
diff --git a/src/mir_app/src/db_intf.cpp b/src/mir_app/src/db_intf.cpp
index 6207dedeab..f3b445a4fa 100644
--- a/src/mir_app/src/db_intf.cpp
+++ b/src/mir_app/src/db_intf.cpp
@@ -72,6 +72,7 @@ MIR_APP_EXPORT HANDLE
g_hevEventAdded, // ME_DB_EVENT_ADDED
g_hevEventEdited, // ME_DB_EVENT_EDITED
g_hevEventDeleted, // ME_DB_EVENT_DELETED
+ g_hevEventDelivered, // ME_DB_EVENT_DELIVERED
g_hevEventFiltered;
int LoadDbintfModule()
@@ -85,6 +86,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_hevEventDelivered = CreateHookableEvent(ME_DB_EVENT_DELIVERED);
g_hevEventFiltered = CreateHookableEvent(ME_DB_EVENT_FILTER_ADD);
while (!_waccess(L"libmdbx.mir", 0)) {
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index f2511af7d7..d557bce2dd 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -969,3 +969,4 @@ _Netlib_DownloadFile@20 @1099 NONAME
?MarkEventRead@CSrmmBaseDialog@@QAEXABVEventInfo@DB@@@Z @1105 NONAME
?getEvent@EventInfo@DB@@QBEIXZ @1106 NONAME
?GetPreviewPath@PROTO_INTERFACE@@QBE?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@XZ @1107 NONAME
+g_hevEventDelivered @1108 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 9fbb61bf87..575e6f63f0 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -969,3 +969,4 @@ Netlib_DownloadFile @1093 NONAME
?MarkEventRead@CSrmmBaseDialog@@QEAAXAEBVEventInfo@DB@@@Z @1099 NONAME
?getEvent@EventInfo@DB@@QEBAIXZ @1100 NONAME
?GetPreviewPath@PROTO_INTERFACE@@QEBA?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@XZ @1101 NONAME
+g_hevEventDelivered @1102 NONAME
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp
index e653d51a5f..a8c2db679c 100644
--- a/src/mir_core/src/db.cpp
+++ b/src/mir_core/src/db.cpp
@@ -427,6 +427,12 @@ MIR_CORE_DLL(int) db_event_delete(MEVENT hDbEvent, int flags)
return g_pCurrDb->DeleteEvent(hDbEvent);
}
+MIR_CORE_DLL(int) db_event_delivered(MCONTACT hContact, MEVENT hDbEvent)
+{
+ NotifyEventHooks(g_hevEventDelivered, hContact, hDbEvent);
+ return 0;
+}
+
MIR_CORE_DLL(int) db_event_edit(MEVENT hDbEvent, const DBEVENTINFO *dbei, bool bFromServer)
{
if (g_pCurrDb == nullptr)
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 1182fddbd6..9ef066901d 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1560,8 +1560,8 @@ db_event_updateId @1772
_TranslateW_UUID@8 @1785 NONAME
?Langpack_GetDefaultLocaleName@@YGPADXZ @1786 NONAME
_EventExists@4 @1787 NONAME
-?SetTooltip@CCtrlMButton@@QAEXPBD@Z @1788 NONAME
-_newStr@4 @1789 NONAME
+_newStr@4 @1788 NONAME
+_newStrW@4 @1789 NONAME
?ChildElementCount@XMLNode@tinyxml2@@QBEHPBD@Z @1790 NONAME
?ChildElementCount@XMLNode@tinyxml2@@QBEHXZ @1791 NONAME
??0MClipAnsi@@QAE@PBD@Z @1792 NONAME
@@ -1577,4 +1577,5 @@ _newStr@4 @1789 NONAME
?Copy@MClipRtf@@UBEXXZ @1802 NONAME
?Copy@MClipUnicode@@UBEXXZ @1803 NONAME
?GetPlainRtf@CCtrlRichEdit@@QAEPAD_N@Z @1804 NONAME
-_newStrW@4 @1805 NONAME
+?SetTooltip@CCtrlMButton@@QAEXPBD@Z @1805 NONAME
+_db_event_delivered@8 @1806 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 140c69f7bf..4e1ba01b17 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1560,8 +1560,8 @@ db_event_updateId @1772
TranslateW_UUID @1785 NONAME
?Langpack_GetDefaultLocaleName@@YAPEADXZ @1786 NONAME
EventExists @1787 NONAME
-?SetTooltip@CCtrlMButton@@QEAAXPEBD@Z @1788 NONAME
-newStr @1789 NONAME
+newStr @1788 NONAME
+newStrW @1789 NONAME
?ChildElementCount@XMLNode@tinyxml2@@QEBAHPEBD@Z @1790 NONAME
?ChildElementCount@XMLNode@tinyxml2@@QEBAHXZ @1791 NONAME
??0MClipAnsi@@QEAA@PEBD@Z @1792 NONAME
@@ -1577,4 +1577,5 @@ newStr @1789 NONAME
?Copy@MClipRtf@@UEBAXXZ @1802 NONAME
?Copy@MClipUnicode@@UEBAXXZ @1803 NONAME
?GetPlainRtf@CCtrlRichEdit@@QEAAPEAD_N@Z @1804 NONAME
-newStrW @1805 NONAME
+?SetTooltip@CCtrlMButton@@QEAAXPEBD@Z @1805 NONAME
+db_event_delivered @1806 NONAME