From 831890a8024a9519cdf725c5a098898734e54e93 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 25 Feb 2014 21:19:01 +0000 Subject: metacontacts in the database cache git-svn-id: http://svn.miranda-ng.org/main/trunk@8276 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbcontacts.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'plugins/Db3x_mmap') diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index 576b19a4f8..09bb9a3e91 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -245,6 +245,19 @@ void CDb3Mmap::FillContacts() DBCachedContact *cc = m_cache->AddContactToCache(dwContactID); cc->dwDriverData = dwOffset; CheckProto(cc, ""); + + DBVARIANT dbv; dbv.type = DBVT_DWORD; + cc->nSubs = (0 != GetContactSetting(dwContactID, "MetaContacts", "NumContacts", &dbv)) ? -1 : dbv.dVal; + if (cc->nSubs != -1) { + cc->pSubs = (MCONTACT*)malloc(cc->nSubs*sizeof(MCONTACT)); + for (int i = 0; i < cc->nSubs; i++) { + char setting[100]; + mir_snprintf(setting, sizeof(setting), "Handle%d", i); + cc->pSubs[i] = (0 != GetContactSetting(dwContactID, "MetaContacts", setting, &dbv)) ? INVALID_CONTACT_ID : dbv.dVal; + } + } + cc->activeID = (0 != GetContactSetting(dwContactID, "MetaContacts", "Default", &dbv)) ? INVALID_CONTACT_ID : dbv.dVal; + cc->parentID = (0 != GetContactSetting(dwContactID, "MetaContacts", "Handle", &dbv)) ? INVALID_CONTACT_ID : dbv.dVal; dwOffset = p->ofsNext; } -- cgit v1.2.3