From cdb38643227904cb58bd144abb06c1d5cb2d92e5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 3 Mar 2014 11:00:55 +0000 Subject: this piece of code to be rewritten later git-svn-id: http://svn.miranda-ng.org/main/trunk@8372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbcontacts.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbcontacts.cpp') diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index 1337341bde..7d2e9aad52 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -258,24 +258,26 @@ void CDb3Mmap::FillContacts() } cc->activeID = (0 != GetContactSetting(dwContactID, META_PROTO, "Default", &dbv)) ? NULL : dbv.dVal; cc->parentID = (0 != GetContactSetting(dwContactID, META_PROTO, "Handle", &dbv)) ? NULL : dbv.dVal; - - // whether we need conversion or not - if (!GetContactSetting(dwContactID, META_PROTO, "MetaID", &dbv)) { - // we don't need it anymore - DeleteContactSetting(dwContactID, META_PROTO, "MetaID"); - - for (int i = 0; i < cc->nSubs; i++) { - // store contact id instead of the old mc number - DBCONTACTWRITESETTING dbws = { META_PROTO, "ParentMeta" }; - dbws.value.type = DBVT_DWORD; - dbws.value.dVal = dwContactID; - WriteContactSetting(cc->pSubs[i], &dbws); - - // wipe out old data from subcontacts - DeleteContactSetting(cc->pSubs[i], META_PROTO, "ContactNumber"); - DeleteContactSetting(cc->pSubs[i], META_PROTO, "MetaLink"); + + #ifdef _DEBUG + // whether we need conversion or not + if (!GetContactSetting(dwContactID, META_PROTO, "MetaID", &dbv)) { + // we don't need it anymore + DeleteContactSetting(dwContactID, META_PROTO, "MetaID"); + + for (int i = 0; i < cc->nSubs; i++) { + // store contact id instead of the old mc number + DBCONTACTWRITESETTING dbws = { META_PROTO, "ParentMeta" }; + dbws.value.type = DBVT_DWORD; + dbws.value.dVal = dwContactID; + WriteContactSetting(cc->pSubs[i], &dbws); + + // wipe out old data from subcontacts + DeleteContactSetting(cc->pSubs[i], META_PROTO, "ContactNumber"); + DeleteContactSetting(cc->pSubs[i], META_PROTO, "MetaLink"); + } } - } + #endif dwOffset = p->ofsNext; } -- cgit v1.2.3