summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/dbcontacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Db3x_mmap/src/dbcontacts.cpp')
-rw-r--r--plugins/Db3x_mmap/src/dbcontacts.cpp40
1 files changed, 3 insertions, 37 deletions
diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp
index 218080763a..44af1cdc95 100644
--- a/plugins/Db3x_mmap/src/dbcontacts.cpp
+++ b/plugins/Db3x_mmap/src/dbcontacts.cpp
@@ -376,36 +376,6 @@ BOOL CDb3Mmap::MetaSplitHistory(DBCachedContact *ccMeta, DBCachedContact *ccSub)
return ret;
}
-/////////////////////////////////////////////////////////////////////////////////////////
-// contacts convertor
-
-#define OLD_CONTACT_SIZE offsetof(DBContact, dwContactID)
-
-void CDb3Mmap::ConvertContacts()
-{
- DBContact *pPrev = NULL;
-
- m_dbHeader.ofsUser = ReallocSpace(m_dbHeader.ofsUser, OLD_CONTACT_SIZE, sizeof(DBContact));
- DBWrite(0, &m_dbHeader, sizeof(m_dbHeader));
-
- for (DWORD dwOffset = m_dbHeader.ofsFirstContact; dwOffset != 0;) {
- DBContact *pOld = (DBContact*)DBRead(dwOffset, sizeof(DBContact), NULL);
- DWORD dwNew = ReallocSpace(dwOffset, OLD_CONTACT_SIZE, sizeof(DBContact));
- DBContact *pNew = (DBContact*)DBRead(dwNew, sizeof(DBContact), NULL);
- pNew->dwContactID = m_dwMaxContactId++;
-
- if (pPrev == NULL)
- m_dbHeader.ofsFirstContact = dwNew;
- else
- pPrev->ofsNext = dwNew;
- pPrev = pNew;
-
- m_contactsMap.insert(new ConvertedContact(dwOffset, pNew->dwContactID));
- dwOffset = pNew->ofsNext;
- }
-
- FlushViewOfFile(m_pDbCache, 0);
-}
void CDb3Mmap::FillContacts()
{
@@ -416,13 +386,9 @@ void CDb3Mmap::FillContacts()
if (p->signature != DBCONTACT_SIGNATURE)
break;
- DWORD dwContactID;
- if (m_dbHeader.version >= DB_095_VERSION) {
- dwContactID = p->dwContactID;
- if (dwContactID >= m_dwMaxContactId)
- m_dwMaxContactId = dwContactID + 1;
- }
- else dwContactID = m_dwMaxContactId++;
+ DWORD dwContactID = p->dwContactID;
+ if (dwContactID >= m_dwMaxContactId)
+ m_dwMaxContactId = dwContactID + 1;
DBCachedContact *cc = m_cache->AddContactToCache(dwContactID);
cc->dwDriverData = dwOffset;