diff options
Diffstat (limited to 'plugins/Dbx_mdb/src/dbcontacts.cpp')
-rw-r--r-- | plugins/Dbx_mdb/src/dbcontacts.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp index 55b34aef5c..14f42e9d70 100644 --- a/plugins/Dbx_mdb/src/dbcontacts.cpp +++ b/plugins/Dbx_mdb/src/dbcontacts.cpp @@ -98,13 +98,6 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID) MDB_val key = { sizeof(MCONTACT), &contactID }, data;
- for (;; Remap())
- {
- txn_ptr trnlck(m_pMdbEnv);
- MDB_CHECK(mdb_del(trnlck, m_dbContacts, &key, nullptr), 1);
- if (trnlck.commit())
- break;
- }
{
LIST<EventItem> events(50);
GatherContactHistory(contactID, events);
@@ -137,6 +130,14 @@ STDMETHODIMP_(LONG) CDbxMdb::DeleteContact(MCONTACT contactID) txn.commit();
}
+ for (;; Remap())
+ {
+ txn_ptr trnlck(m_pMdbEnv);
+ MDB_CHECK(mdb_del(trnlck, m_dbContacts, &key, nullptr), 1);
+ if (trnlck.commit())
+ break;
+ }
+
m_contactCount--;
m_cache->FreeCachedContact(contactID);
@@ -168,6 +169,7 @@ STDMETHODIMP_(MCONTACT) CDbxMdb::AddContact() if (trnlck.commit())
break;
}
+ m_contactCount++;
}
NotifyEventHooks(hContactAddedEvent, dwContactId, 0);
|