diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2012-10-07 17:10:29 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2012-10-07 17:10:29 +0000 |
commit | 8d42163a160b263abf709414db8b973f74b4d355 (patch) | |
tree | d44fc6a25ced661d493c5fa9f9b138680d47805b /protocols/Skype/src/skype_settings.cpp | |
parent | ecb5d187aec965f0fc021002dbf2afab22d300e8 (diff) |
- second approach to adding/deleting contacts
git-svn-id: http://svn.miranda-ng.org/main/trunk@1806 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_settings.cpp')
-rw-r--r-- | protocols/Skype/src/skype_settings.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/protocols/Skype/src/skype_settings.cpp b/protocols/Skype/src/skype_settings.cpp index 88826fb613..71cf0e2b1c 100644 --- a/protocols/Skype/src/skype_settings.cpp +++ b/protocols/Skype/src/skype_settings.cpp @@ -33,15 +33,15 @@ DWORD CSkypeProto::GetSettingDword(const char *setting, DWORD errorValue) wchar_t* CSkypeProto::GetSettingString(HANDLE hContact, const char *setting, wchar_t* errorValue)
{
DBVARIANT dbv;
- wchar_t* result = NULL;
+ wchar_t* result = errorValue;
if ( !::DBGetContactSettingWString(hContact, this->m_szModuleName, setting, &dbv))
{
- result = mir_wstrdup(dbv.pwszVal);
+ result = ::mir_wstrdup(dbv.pwszVal);
DBFreeVariant(&dbv);
}
- return result != NULL ? result : errorValue;
+ return result;
}
wchar_t* CSkypeProto::GetSettingString(const char *setting, wchar_t* errorValue)
@@ -51,12 +51,19 @@ wchar_t* CSkypeProto::GetSettingString(const char *setting, wchar_t* errorValue) wchar_t* CSkypeProto::GetDecodeSettingString(HANDLE hContact, const char *setting, wchar_t* errorValue)
{
- TCHAR* result = this->GetSettingString(hContact, setting, errorValue);
+ DBVARIANT dbv;
+ wchar_t* result = errorValue;
- CallService(
- MS_DB_CRYPT_DECODESTRING,
- wcslen(result) + 1,
- reinterpret_cast<LPARAM>(result));
+ if ( !::DBGetContactSettingWString(hContact, this->m_szModuleName, setting, &dbv))
+ {
+ result = ::mir_wstrdup(dbv.pwszVal);
+ DBFreeVariant(&dbv);
+
+ CallService(
+ MS_DB_CRYPT_DECODESTRING,
+ wcslen(result) + 1,
+ reinterpret_cast<LPARAM>(result));
+ }
return result;
}
|