summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbsettings.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-10 12:39:54 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-10 12:39:54 +0000
commited3d8bba1b542e0bbf382a6f2eb4b78147d10bc0 (patch)
tree1aa1aa2cff7f8bcb6ac8a6883f3b7ce280cad072 /plugins/Dbx_mdb/src/dbsettings.cpp
parentef65d01f2525cf6d52a59c0df06b4f8e4cf924ec (diff)
- writeable module names;
- compilation fix for 32 bits build; - DatabaseCorruption() returned git-svn-id: http://svn.miranda-ng.org/main/trunk@11812 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbsettings.cpp')
-rw-r--r--plugins/Dbx_mdb/src/dbsettings.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/Dbx_mdb/src/dbsettings.cpp b/plugins/Dbx_mdb/src/dbsettings.cpp
index 46d3540185..099625a1d2 100644
--- a/plugins/Dbx_mdb/src/dbsettings.cpp
+++ b/plugins/Dbx_mdb/src/dbsettings.cpp
@@ -79,6 +79,7 @@ int CDbxMdb::GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCSTR
mir_cslock lck(m_csDbAccess);
+LBL_Seek:
char *szCachedSettingName = m_cache->GetCachedSetting(szModule, szSetting, moduleNameLen, settingNameLen);
log3("get [%08p] %s (%p)", hContact, szCachedSettingName, szCachedSettingName);
@@ -116,6 +117,20 @@ int CDbxMdb::GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCSTR
if (szCachedSettingName[-1] != 0)
return 1;
+ DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : NULL;
+
+ DWORD ofsModuleName = GetModuleNameOfs(szModule);
+
+ // try to get the missing mc setting from the active sub
+ if (cc && cc->IsMeta() && ValidLookupName(szModule, szSetting)) {
+ if (contactID = db_mc_getDefault(contactID)) {
+ if (szModule = GetContactProto(contactID)) {
+ moduleNameLen = (int)strlen(szModule);
+ goto LBL_Seek;
+ }
+ }
+ }
+
return 1;
}