From 8d42163a160b263abf709414db8b973f74b4d355 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 7 Oct 2012 17:10:29 +0000 Subject: - second approach to adding/deleting contacts git-svn-id: http://svn.miranda-ng.org/main/trunk@1806 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_settings.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'protocols/Skype/src/skype_settings.cpp') 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(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(result)); + } return result; } -- cgit v1.2.3