summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-17 17:16:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-17 17:16:53 +0300
commita134962a8ac19a0013e9dec8d747eca455525946 (patch)
tree8ad20c484680ab1f7729722d60c96f67aba96bee /plugins/Db3x_mmap/src
parentbc0b6bfb2734ce8355ddfb9b20461321c08a0b0c (diff)
fixes #739 (extra icons don't work in the totally encrypted database)
Diffstat (limited to 'plugins/Db3x_mmap/src')
-rw-r--r--plugins/Db3x_mmap/src/dbsettings.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp
index f7eb6e0d84..2690e1da27 100644
--- a/plugins/Db3x_mmap/src/dbsettings.cpp
+++ b/plugins/Db3x_mmap/src/dbsettings.cpp
@@ -441,6 +441,8 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSetting(MCONTACT contactID, DBCONTACTW
return 1;
DBCONTACTWRITESETTING dbcwWork = dbcwNotif;
+ char *szCachedSettingName = m_cache->GetCachedSetting(dbcwWork.szModule, dbcwWork.szSetting, moduleNameLen, settingNameLen);
+ bool bIsResident = szCachedSettingName[-1] != 0;
mir_ptr<BYTE> pEncoded(NULL);
bool bIsEncrypted = false;
@@ -449,7 +451,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSetting(MCONTACT contactID, DBCONTACTW
break;
case DBVT_ASCIIZ: case DBVT_UTF8:
- bIsEncrypted = m_bEncrypted || IsSettingEncrypted(dbcws->szModule, dbcws->szSetting);
+ bIsEncrypted = !bIsResident && (m_bEncrypted || IsSettingEncrypted(dbcws->szModule, dbcws->szSetting));
LBL_WriteString:
if (dbcwWork.value.pszVal == NULL)
return 1;
@@ -485,7 +487,6 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSetting(MCONTACT contactID, DBCONTACTW
return 2;
}
- char *szCachedSettingName = m_cache->GetCachedSetting(dbcwWork.szModule, dbcwWork.szSetting, moduleNameLen, settingNameLen);
log3("set [%08p] %s (%p)", hContact, szCachedSettingName, szCachedSettingName);
// we don't cache blobs and passwords
@@ -506,7 +507,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSetting(MCONTACT contactID, DBCONTACTW
}
m_cache->SetCachedVariant(&dbcwWork.value, pCachedValue);
}
- if (szCachedSettingName[-1] != 0) {
+ if (bIsResident) {
lck.unlock();
log2(" set resident as %s (%p)", printVariant(&dbcwWork.value), pCachedValue);
NotifyEventHooks(hSettingChangeEvent, contactID, (LPARAM)&dbcwWork);