From e35464b3a1c3a5af68b348803049d90d73c1bc0d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 Jul 2014 11:09:16 +0000 Subject: all profile conversion stuff moved to dbchecker git-svn-id: http://svn.miranda-ng.org/main/trunk@9880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbtool/contactchain.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbtool/contactchain.cpp') diff --git a/plugins/Db3x_mmap/src/dbtool/contactchain.cpp b/plugins/Db3x_mmap/src/dbtool/contactchain.cpp index f1ba3ebe61..d149bd0e86 100644 --- a/plugins/Db3x_mmap/src/dbtool/contactchain.cpp +++ b/plugins/Db3x_mmap/src/dbtool/contactchain.cpp @@ -52,8 +52,16 @@ LBL_FinishUp: cb->pfnAddLogMessage(STATUS_ERROR, TranslateT("Contact chain corrupted, further entries ignored")); goto LBL_FinishUp; } - if (ReadSegment(ofsThisContact, &dbc, sizeof(dbc)) != ERROR_SUCCESS) - goto LBL_FinishUp; + + if (m_dbHeader.version < DB_095_VERSION) { + if (ReadSegment(ofsThisContact, &dbc, offsetof(DBContact, dwContactID)) != ERROR_SUCCESS) + goto LBL_FinishUp; + dbc.dwContactID = m_dwMaxContactId++; + } + else { + if (ReadSegment(ofsThisContact, &dbc, sizeof(dbc)) != ERROR_SUCCESS) + goto LBL_FinishUp; + } ofsNextContact = dbc.ofsNext; dbc.ofsNext = 0; @@ -64,6 +72,9 @@ LBL_FinishUp: WriteSegment(ofsDestPrevContact + offsetof(DBContact, ofsNext), &ofsDestThis, sizeof(DWORD)); else m_dbHeader.ofsFirstContact = ofsDestThis; + + if (m_dbHeader.version < DB_095_VERSION) + m_contactsMap.insert(new ConvertedContact(ofsThisContact, ofsDestThis)); } else ofsDestThis = ofsThisContact; // needed in event chain worker -- cgit v1.2.3