summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/dbsettings.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-05-03 15:57:32 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-05-03 15:57:32 +0000
commite04bbf1c49acb1f6994d460c519d1bd03ca912d7 (patch)
tree0fcfda093e93eb087ee240cbe9b7b1adae118ffa /plugins/Db3x_mmap/src/dbsettings.cpp
parentcaeedd1d82e3018be30ec1a65e98ed8e1841c015 (diff)
database to look up the missing settings for the default sub
git-svn-id: http://svn.miranda-ng.org/main/trunk@9114 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbsettings.cpp')
-rw-r--r--plugins/Db3x_mmap/src/dbsettings.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp
index 4c3f8e4b93..c77889bdf3 100644
--- a/plugins/Db3x_mmap/src/dbsettings.cpp
+++ b/plugins/Db3x_mmap/src/dbsettings.cpp
@@ -71,6 +71,7 @@ int CDb3Mmap::GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCST
char *szCachedSettingName = m_cache->GetCachedSetting(szModule, szSetting, moduleNameLen, settingNameLen);
log3("get [%08p] %s (%p)", hContact, szCachedSettingName, szCachedSettingName);
+LBL_Seek:
DBVARIANT *pCachedValue = m_cache->GetCachedValuePtr(contactID, szCachedSettingName, 0);
if (pCachedValue != NULL) {
if (pCachedValue->type == DBVT_ASCIIZ || pCachedValue->type == DBVT_UTF8) {
@@ -105,8 +106,10 @@ int CDb3Mmap::GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCST
if (szCachedSettingName[-1] != 0)
return 1;
+ DBCachedContact *cc;
+ DWORD ofsContact = GetContactOffset(contactID, &cc);
+
DWORD ofsModuleName = GetModuleNameOfs(szModule);
- DWORD ofsContact = GetContactOffset(contactID);
DBContact dbc = *(DBContact*)DBRead(ofsContact,sizeof(DBContact),NULL);
if (dbc.signature != DBCONTACT_SIGNATURE)
@@ -219,6 +222,12 @@ int CDb3Mmap::GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCST
}
}
+ // try to get the missing mc setting from the active sub
+ if (cc && cc->IsMeta()) {
+ contactID = db_mc_getDefault(contactID);
+ goto LBL_Seek;
+ }
+
logg();
return 1;
}