summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_settings.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2012-10-13 14:38:12 +0000
committerAlexander Lantsev <aunsane@gmail.com>2012-10-13 14:38:12 +0000
commit85683af6f692614dec3c5741811cee3d2565f999 (patch)
tree640f3103205f68ed6e3dc7be7909b062d31e2f7a /protocols/Skype/src/skype_settings.cpp
parent6b30f907de8ee2dd3bb8eedd5bee89ad84740765 (diff)
- reworked signIn(Thread) function
- fixed password request logic git-svn-id: http://svn.miranda-ng.org/main/trunk@1907 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_settings.cpp')
-rw-r--r--protocols/Skype/src/skype_settings.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/protocols/Skype/src/skype_settings.cpp b/protocols/Skype/src/skype_settings.cpp
index 71cf0e2b1c..3e0d4de2d5 100644
--- a/protocols/Skype/src/skype_settings.cpp
+++ b/protocols/Skype/src/skype_settings.cpp
@@ -32,13 +32,17 @@ 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 = errorValue;
+ DBVARIANT dbv = {0};
+ wchar_t* result = NULL;
if ( !::DBGetContactSettingWString(hContact, this->m_szModuleName, setting, &dbv))
{
result = ::mir_wstrdup(dbv.pwszVal);
- DBFreeVariant(&dbv);
+ ::DBFreeVariant(&dbv);
+ }
+ else
+ {
+ result = ::mir_wstrdup(errorValue);
}
return result;
@@ -51,19 +55,21 @@ wchar_t* CSkypeProto::GetSettingString(const char *setting, wchar_t* errorValue)
wchar_t* CSkypeProto::GetDecodeSettingString(HANDLE hContact, const char *setting, wchar_t* errorValue)
{
- DBVARIANT dbv;
- wchar_t* result = errorValue;
+ DBVARIANT dbv = {0};
+ wchar_t* result = NULL;
if ( !::DBGetContactSettingWString(hContact, this->m_szModuleName, setting, &dbv))
{
result = ::mir_wstrdup(dbv.pwszVal);
- DBFreeVariant(&dbv);
+ ::DBFreeVariant(&dbv);
- CallService(
+ ::CallService(
MS_DB_CRYPT_DECODESTRING,
- wcslen(result) + 1,
+ ::wcslen(result) + 1,
reinterpret_cast<LPARAM>(result));
}
+ else
+ result = ::mir_wstrdup(errorValue);
return result;
}
@@ -117,10 +123,15 @@ bool CSkypeProto::SetSettingString(const char *szSetting, const wchar_t* value)
bool CSkypeProto::SetDecodeSettingString(HANDLE hContact, const char *setting, const wchar_t* value)
{
- TCHAR* result = mir_wstrdup(value);
- CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(result), reinterpret_cast<LPARAM>(result));
+ if(::wcscmp(value, L"") != 0)
+ {
+ wchar_t* result = ::mir_wstrdup(value);
+ ::CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(result), reinterpret_cast<LPARAM>(result));
+
+ return !this->SetSettingString(hContact, setting, result);
+ }
- return !this->SetSettingString(hContact, setting, result);
+ return !this->SetSettingString(hContact, setting, value);
}
bool CSkypeProto::SetDecodeSettingString(const char *setting, const wchar_t* value)