From ed3d8bba1b542e0bbf382a6f2eb4b78147d10bc0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 10 Jan 2015 12:39:54 +0000 Subject: - 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 --- plugins/Dbx_mdb/src/dbsettings.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'plugins/Dbx_mdb/src/dbsettings.cpp') 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; } -- cgit v1.2.3