diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-18 18:46:26 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-18 18:46:26 +0000 |
commit | 78b61b8fbd46d1689267a1d8e7ca0f315cf73543 (patch) | |
tree | a6c2dcf2114c4e1159eccc8090bd2aaa52020a7e /plugins/Db3x_mmap | |
parent | 3791ce0c509d1d7a64cbba67015db38f4db5404c (diff) |
merge with trunk
git-svn-id: http://svn.miranda-ng.org/main/trunk@8167 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r-- | plugins/Db3x_mmap/src/dbevents.cpp | 5 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbintf.cpp | 2 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbintf.h | 2 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/version.h | 2 |
4 files changed, 8 insertions, 3 deletions
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 <stdver.h>
|