summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/dbtool/contactchain.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-07-20 11:09:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-07-20 11:09:16 +0000
commite35464b3a1c3a5af68b348803049d90d73c1bc0d (patch)
treebe5f05a3cb1b490653132afb735d9befeba4352b /plugins/Db3x_mmap/src/dbtool/contactchain.cpp
parent7663d8886a2e059232287b6652ead02142f6d6fc (diff)
all profile conversion stuff moved to dbchecker
git-svn-id: http://svn.miranda-ng.org/main/trunk@9880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbtool/contactchain.cpp')
-rw-r--r--plugins/Db3x_mmap/src/dbtool/contactchain.cpp15
1 files changed, 13 insertions, 2 deletions
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