summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-01-19 20:02:44 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-01-19 20:02:44 +0300
commit5090efd0acaf21325a052a3041d1f2e52e14c5d8 (patch)
treeefe1be468485f6865e2e679b5455bce1380d1a5c /plugins
parentce5ad76fb6bf22511a91494928bded45056aba45 (diff)
Dbx_mdbx: fix for reversed event cursors behavior
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Dbx_mdbx/src/dbevents.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/Dbx_mdbx/src/dbevents.cpp b/plugins/Dbx_mdbx/src/dbevents.cpp
index 5a65990419..e2494a9c00 100644
--- a/plugins/Dbx_mdbx/src/dbevents.cpp
+++ b/plugins/Dbx_mdbx/src/dbevents.cpp
@@ -657,6 +657,13 @@ public:
if (mdbx_cursor_get(m_pOwner->m_curEventsSort, &key, &data, MDBX_SET_RANGE) != MDBX_SUCCESS)
return 0;
dbKey = *(const DBEventSortingKey *)key.iov_base;
+
+ if (!m_bForward && dbKey.hContact) {
+ if (mdbx_cursor_get(m_pOwner->m_curEventsSort, &key, &data, MDBX_PREV) != MDBX_SUCCESS)
+ return 0;
+
+ dbKey = *(const DBEventSortingKey *)key.iov_base;
+ }
}
else {
if (mdbx_cursor_get(m_pOwner->m_curEventsSort, &key, &data, MDBX_SET) != MDBX_SUCCESS)