diff options
author | George Hazan <ghazan@miranda.im> | 2020-10-09 17:23:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-10-09 17:23:04 +0300 |
commit | 2828f80c86cf8bde114c7ba11bcce4b4d32e2af6 (patch) | |
tree | 7d8043ffd10dd1f931f78bffe6ad5e1b3261b4cd /plugins/Dbx_mdbx/src/dbcontacts.cpp | |
parent | a519d4617ed83a2167a693ae87934e56889fef05 (diff) |
Dbx_mdbx: fix for new constants
Diffstat (limited to 'plugins/Dbx_mdbx/src/dbcontacts.cpp')
-rw-r--r-- | plugins/Dbx_mdbx/src/dbcontacts.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/Dbx_mdbx/src/dbcontacts.cpp b/plugins/Dbx_mdbx/src/dbcontacts.cpp index 239cec81b9..3cfca21013 100644 --- a/plugins/Dbx_mdbx/src/dbcontacts.cpp +++ b/plugins/Dbx_mdbx/src/dbcontacts.cpp @@ -61,7 +61,7 @@ LONG CDbxMDBX::DeleteContact(MCONTACT contactID) if (pKey->hContact != contactID)
break;
- if (mdbx_cursor_del(cursor, 0) != MDBX_SUCCESS)
+ if (mdbx_cursor_del(cursor, MDBX_UPSERT) != MDBX_SUCCESS)
return 1;
if (!cc->IsMeta() && !cc->IsSub()) {
@@ -88,7 +88,7 @@ LONG CDbxMDBX::DeleteContact(MCONTACT contactID) if (pKey->hContact != contactID)
break;
- if (mdbx_cursor_del(cursor, 0) != MDBX_SUCCESS)
+ if (mdbx_cursor_del(cursor, MDBX_UPSERT) != MDBX_SUCCESS)
return 1;
}
@@ -123,7 +123,7 @@ MCONTACT CDbxMDBX::AddContact() MDBX_val data = { &cc->dbc, sizeof(cc->dbc) };
txn_ptr trnlck(StartTran());
- if (mdbx_put(trnlck, m_dbContacts, &key, &data, 0) != MDBX_SUCCESS)
+ if (mdbx_put(trnlck, m_dbContacts, &key, &data, MDBX_UPSERT) != MDBX_SUCCESS)
return 0;
if (trnlck.commit() != MDBX_SUCCESS)
return 0;
@@ -170,7 +170,7 @@ BOOL CDbxMDBX::MetaMergeHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) DBEventSortingKey insVal = { ccMeta->contactID, EI->eventId, EI->ts };
MDBX_val key = { &insVal, sizeof(insVal) }, data = { (void*)"", 1 };
- if (mdbx_put(trnlck, m_dbEventsSort, &key, &data, 0) != MDBX_SUCCESS)
+ if (mdbx_put(trnlck, m_dbEventsSort, &key, &data, MDBX_UPSERT) != MDBX_SUCCESS)
return 1;
if (trnlck.commit() != MDBX_SUCCESS)
@@ -181,7 +181,7 @@ BOOL CDbxMDBX::MetaMergeHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) MDBX_val keyc = { &ccMeta->contactID, sizeof(MCONTACT) }, datac = { &ccMeta->dbc, sizeof(ccMeta->dbc) };
txn_ptr trnlck(StartTran());
- if (mdbx_put(trnlck, m_dbContacts, &keyc, &datac, 0) != MDBX_SUCCESS)
+ if (mdbx_put(trnlck, m_dbContacts, &keyc, &datac, MDBX_UPSERT) != MDBX_SUCCESS)
return 1;
if (trnlck.commit() != MDBX_SUCCESS)
return 1;
@@ -211,7 +211,7 @@ BOOL CDbxMDBX::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub) txn_ptr trnlck(StartTran());
MDBX_val keyc = { &ccMeta->contactID, sizeof(MCONTACT) }, datac = { &ccMeta->dbc, sizeof(ccMeta->dbc) };
- if (mdbx_put(trnlck, m_dbContacts, &keyc, &datac, 0) != MDBX_SUCCESS)
+ if (mdbx_put(trnlck, m_dbContacts, &keyc, &datac, MDBX_UPSERT) != MDBX_SUCCESS)
return 1;
if (trnlck.commit() != MDBX_SUCCESS)
return 1;
@@ -234,7 +234,7 @@ BOOL CDbxMDBX::MetaRemoveSubHistory(DBCachedContact *ccSub) if (mdbx_get(trnlck, m_dbEvents, &key, &data) == MDBX_SUCCESS) {
DBEvent *pEvent = (DBEvent*)data.iov_base;
pEvent->dwContactID = ccSub->parentID;
- if (mdbx_put(trnlck, m_dbEvents, &key, &data, 0) != MDBX_SUCCESS)
+ if (mdbx_put(trnlck, m_dbEvents, &key, &data, MDBX_UPSERT) != MDBX_SUCCESS)
return 1;
}
}
|