summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-10-03 15:54:52 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-10-03 15:54:59 +0300
commit3659d753293c8c13ad396a925efa7577fe3796c5 (patch)
tree700b34256251b98f0319a19a4560f85f274254a9 /plugins/Dbx_mdbx/src
parent39fb3e8fa1f2603bdca1cf005d382c18b0f3f993 (diff)
dbx_mdbx: fix for editing events
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-rw-r--r--plugins/Dbx_mdbx/src/dbevents.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/Dbx_mdbx/src/dbevents.cpp b/plugins/Dbx_mdbx/src/dbevents.cpp
index a99471361f..545cfd95ce 100644
--- a/plugins/Dbx_mdbx/src/dbevents.cpp
+++ b/plugins/Dbx_mdbx/src/dbevents.cpp
@@ -138,6 +138,16 @@ BOOL CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbei)
if (dbei == nullptr) return 1;
if (dbei->timestamp == 0) return 1;
+ {
+ txn_ptr_ro txn(m_txn_ro);
+ MDBX_val key = { &hDbEvent, sizeof(MEVENT) }, data;
+ if (mdbx_get(txn, m_dbEvents, &key, &data) != MDBX_SUCCESS)
+ return 1;
+
+ DBEvent *dbe = (DBEvent*)data.iov_base;
+ dbei->timestamp = dbe->timestamp;
+ }
+
return EditEvent(contactID, hDbEvent, dbei, false);
}