diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-09 20:56:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-09 20:56:06 +0000 |
commit | 9191a0aefc5213a44bb2f6fbffd732771b4e0264 (patch) | |
tree | 43a98f22f87a2b0f9039a3a5a5fdad43c3ab6dc6 /protocols/Skype/src/skype_settings.cpp | |
parent | f3aa4bd3f0283c8a0421fb82b6bdc17ea73f7454 (diff) |
- added 64 bit config;
- password storage fixed;
- bunch of crash fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@2708 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_settings.cpp')
-rw-r--r-- | protocols/Skype/src/skype_settings.cpp | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/protocols/Skype/src/skype_settings.cpp b/protocols/Skype/src/skype_settings.cpp index 3e0d4de2d5..233867c510 100644 --- a/protocols/Skype/src/skype_settings.cpp +++ b/protocols/Skype/src/skype_settings.cpp @@ -53,32 +53,26 @@ wchar_t* CSkypeProto::GetSettingString(const char *setting, wchar_t* errorValue) return this->GetSettingString(NULL, setting, errorValue);
}
-wchar_t* CSkypeProto::GetDecodeSettingString(HANDLE hContact, const char *setting, wchar_t* errorValue)
+char* CSkypeProto::GetDecodeSettingString(HANDLE hContact, const char *setting, char* errorValue)
{
DBVARIANT dbv = {0};
- wchar_t* result = NULL;
+ char* result = NULL;
- if ( !::DBGetContactSettingWString(hContact, this->m_szModuleName, setting, &dbv))
+ if ( !::DBGetContactSettingString(hContact, this->m_szModuleName, setting, &dbv))
{
- result = ::mir_wstrdup(dbv.pwszVal);
+ result = ::mir_strdup(dbv.pszVal);
::DBFreeVariant(&dbv);
::CallService(
MS_DB_CRYPT_DECODESTRING,
- ::wcslen(result) + 1,
+ ::strlen(result),
reinterpret_cast<LPARAM>(result));
}
- else
- result = ::mir_wstrdup(errorValue);
+ else result = ::mir_strdup(errorValue);
return result;
}
-wchar_t* CSkypeProto::GetDecodeSettingString(const char *setting, wchar_t* errorValue)
-{
- return this->GetDecodeSettingString(NULL, setting, errorValue);
-}
-
//
bool CSkypeProto::SetSettingByte(HANDLE hContact, const char *setting, BYTE value)
@@ -121,22 +115,17 @@ bool CSkypeProto::SetSettingString(const char *szSetting, const wchar_t* value) return this->SetSettingString(NULL, szSetting, value);
}
-bool CSkypeProto::SetDecodeSettingString(HANDLE hContact, const char *setting, const wchar_t* value)
+bool CSkypeProto::SetDecodeSettingString(HANDLE hContact, const char *setting, const char* value)
{
- if(::wcscmp(value, L"") != 0)
+ if( ::strcmp(value, ""))
{
- wchar_t* result = ::mir_wstrdup(value);
- ::CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(result), reinterpret_cast<LPARAM>(result));
+ mir_ptr<char> result (::mir_strdup(value));
+ ::CallService(MS_DB_CRYPT_ENCODESTRING, strlen(result), LPARAM((char*)result));
- return !this->SetSettingString(hContact, setting, result);
+ return !db_set_s(hContact, m_szModuleName, setting, result);
}
- return !this->SetSettingString(hContact, setting, value);
-}
-
-bool CSkypeProto::SetDecodeSettingString(const char *setting, const wchar_t* value)
-{
- return this->SetDecodeSettingString(NULL, setting, value);
+ return !this->SetSettingString(hContact, setting, L"");
}
//
|