summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-03-10 16:54:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-03-10 16:54:17 +0000
commit2927b24587cf46907242792bf6190b3c607cbea5 (patch)
treed6cbe2d94a8ca91cc06de68f4f4114d3981def7c /plugins/Dbx_mdb
parentcd72e104e05f62a62f034cebf10c2b171bece2c8 (diff)
fix for reading events
git-svn-id: http://svn.miranda-ng.org/main/trunk@12376 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb')
-rw-r--r--plugins/Dbx_mdb/src/dbevents.cpp4
1 files changed, 3 insertions, 1 deletions
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;