From a7bf177e6e4aedcaafca186b50e6666788e45f98 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 10 Feb 2023 19:46:31 +0300 Subject: ME_DB_EVENT_MARKED_READ: recursion prevention --- include/delphi/m_database.inc | 2 +- include/m_database.h | 2 +- include/m_protoint.h | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/delphi/m_database.inc b/include/delphi/m_database.inc index 3da8ce5123..4c41eac938 100644 --- a/include/delphi/m_database.inc +++ b/include/delphi/m_database.inc @@ -141,7 +141,7 @@ is invalid. This is the one database write operation that does not trigger an event. Modules should not save flags states for any length of time. } -function db_event_markRead(hContact:TMCONTACT; hDbEvent:TMEVENT):int; stdcall; external CoreDLL; +function db_event_markRead(hContact:TMCONTACT; hDbEvent:TMEVENT; flags:integer = 0):int; stdcall; external CoreDLL; { Retrieves a handle to the next event in a chain after hDbEvent diff --git a/include/m_database.h b/include/m_database.h index 9aaffc79eb..1831946c67 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -351,7 +351,7 @@ EXTERN_C MIR_CORE_DLL(MEVENT) db_event_last(MCONTACT hContact); // This is the one database write operation that does not trigger an event. // Modules should not save flags states for any length of time. -EXTERN_C MIR_CORE_DLL(int) db_event_markRead(MCONTACT hContact, MEVENT hDbEvent); +EXTERN_C MIR_CORE_DLL(int) db_event_markRead(MCONTACT hContact, MEVENT hDbEvent, bool bFromServer = false); // Retrieves a handle to the next event in a chain after hDbEvent // Returns the handle, or NULL if hDbEvent is invalid or is the last event diff --git a/include/m_protoint.h b/include/m_protoint.h index 06d3267ff3..184d36d4c5 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -264,6 +264,9 @@ public: // called when an account gets physically removed from the database virtual void OnErase(); + // called when an event is marked read from Miranda (not from the server) + virtual void OnMarkRead(MCONTACT, MEVENT); + // the analog of ME_SYSTEM_MODULESLOADED for an account virtual void OnModulesLoaded(void); -- cgit v1.2.3