From 2927b24587cf46907242792bf6190b3c607cbea5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 10 Mar 2015 16:54:17 +0000 Subject: fix for reading events git-svn-id: http://svn.miranda-ng.org/main/trunk@12376 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbevents.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/Dbx_mdb/src/dbevents.cpp') diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp index c896049e76..ea9b27b390 100644 --- a/plugins/Dbx_mdb/src/dbevents.cpp +++ b/plugins/Dbx_mdb/src/dbevents.cpp @@ -304,6 +304,7 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindFirstEvent(MCONTACT contactID) txn_ptr txn(m_pMdbEnv, true); cursor_ptr cursor(txn, m_dbEventsSort); + mdb_cursor_get(cursor, &key, &data, MDB_SET_KEY); if (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) != MDB_SUCCESS) return 0; @@ -319,13 +320,14 @@ STDMETHODIMP_(MEVENT) CDbxMdb::FindFirstUnreadEvent(MCONTACT contactID) STDMETHODIMP_(MEVENT) CDbxMdb::FindLastEvent(MCONTACT contactID) { - DBEventSortingKey keyVal = { contactID, 0, 0 }; + DBEventSortingKey keyVal = { contactID, -1, -1 }; MDB_val key = { sizeof(keyVal), &keyVal }, data; mir_cslock lck(m_csDbAccess); txn_ptr txn(m_pMdbEnv, true); cursor_ptr cursor(txn, m_dbEventsSort); + mdb_cursor_get(cursor, &key, &data, MDB_SET_KEY); if (mdb_cursor_get(cursor, &key, &data, MDB_PREV) != MDB_SUCCESS) return 0; -- cgit v1.2.3