From 78b61b8fbd46d1689267a1d8e7ca0f315cf73543 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Feb 2014 18:46:26 +0000 Subject: merge with trunk git-svn-id: http://svn.miranda-ng.org/main/trunk@8167 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbevents.cpp | 5 ++++- plugins/Db3x_mmap/src/dbintf.cpp | 2 ++ plugins/Db3x_mmap/src/dbintf.h | 2 +- plugins/Db3x_mmap/src/version.h | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) (limited to 'plugins/Db3x_mmap') diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 472ebcdd82..5610e90e2f 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -270,7 +270,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei) STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent) { - mir_cslock lck(m_csDbAccess); + mir_cslockfull lck(m_csDbAccess); DWORD ofsContact = GetContactOffset(contactID); DBContact dbc = *(DBContact*)DBRead(ofsContact, sizeof(DBContact), NULL); DBEvent *dbe = (DBEvent*)DBRead((DWORD)hDbEvent, sizeof(DBEvent), NULL); @@ -302,6 +302,9 @@ STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent) } DBWrite(ofsContact, &dbc, sizeof(DBContact)); DBFlush(0); + + lck.unlock(); + NotifyEventHooks(hEventMarkedRead, contactID, (LPARAM)hDbEvent); return ret; } diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp index 3481ccccb0..e17dd576f2 100644 --- a/plugins/Db3x_mmap/src/dbintf.cpp +++ b/plugins/Db3x_mmap/src/dbintf.cpp @@ -94,6 +94,7 @@ CDb3Mmap::~CDb3Mmap() DestroyHookableEvent(hContactDeletedEvent); DestroyHookableEvent(hContactAddedEvent); DestroyHookableEvent(hSettingChangeEvent); + DestroyHookableEvent(hEventMarkedRead); DestroyHookableEvent(hEventAddedEvent); DestroyHookableEvent(hEventDeletedEvent); @@ -149,6 +150,7 @@ int CDb3Mmap::Load(bool bSkipInit) hContactDeletedEvent = CreateHookableEvent(ME_DB_CONTACT_DELETED); hContactAddedEvent = CreateHookableEvent(ME_DB_CONTACT_ADDED); hSettingChangeEvent = CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED); + hEventMarkedRead = CreateHookableEvent(ME_DB_EVENT_MARKED_READ); hEventAddedEvent = CreateHookableEvent(ME_DB_EVENT_ADDED); hEventDeletedEvent = CreateHookableEvent(ME_DB_EVENT_DELETED); diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index 633c7aa7f5..361c91dffa 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -267,7 +267,7 @@ public: protected: DWORD m_dwFileSize, m_dwMaxContactId; - HANDLE hSettingChangeEvent, hContactDeletedEvent, hContactAddedEvent; + HANDLE hSettingChangeEvent, hContactDeletedEvent, hContactAddedEvent, hEventMarkedRead; CRITICAL_SECTION m_csDbAccess; diff --git a/plugins/Db3x_mmap/src/version.h b/plugins/Db3x_mmap/src/version.h index ef422c81fb..d23bd34d4f 100644 --- a/plugins/Db3x_mmap/src/version.h +++ b/plugins/Db3x_mmap/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 95 #define __RELEASE_NUM 0 -#define __BUILD_NUM 1 +#define __BUILD_NUM 2 #include -- cgit v1.2.3