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 | |
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')
-rw-r--r-- | protocols/Skype/Skype.vcxproj | 86 | ||||
-rw-r--r-- | protocols/Skype/src/skype.cpp | 6 | ||||
-rw-r--r-- | protocols/Skype/src/skype_contacts.cpp | 6 | ||||
-rw-r--r-- | protocols/Skype/src/skype_dialogs.cpp | 120 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.cpp | 73 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.h | 18 | ||||
-rw-r--r-- | protocols/Skype/src/skype_services.cpp | 8 | ||||
-rw-r--r-- | protocols/Skype/src/skype_settings.cpp | 35 | ||||
-rw-r--r-- | protocols/Skype/src/skype_subclassing.cpp | 3 | ||||
-rw-r--r-- | protocols/Skype/src/skype_utils.cpp | 19 |
10 files changed, 207 insertions, 167 deletions
diff --git a/protocols/Skype/Skype.vcxproj b/protocols/Skype/Skype.vcxproj index 11db0ba153..435ecfeb0f 100644 --- a/protocols/Skype/Skype.vcxproj +++ b/protocols/Skype/Skype.vcxproj @@ -5,10 +5,18 @@ <Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F5282DBC-756B-4071-B186-3E82C0E8E1F7}</ProjectGuid>
@@ -19,28 +27,49 @@ <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -57,7 +86,34 @@ <Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalLibraryDirectories>$(SolutionDir)\lib;$(SolutionDir)..\..\SkypeKit\SDK\lib\Debug</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib;$(SolutionDir)..\..\SkypeKit\SDK\lib\Debug</AdditionalLibraryDirectories>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib.lib;skypekit-cppwrapper_2_lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreAllDefaultLibraries>
+ </IgnoreAllDefaultLibraries>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalOptions>/PDBALTPATH:%_PDB% %(AdditionalOptions)</AdditionalOptions>
+ </Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;SKYPE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\api;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\ipc;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\types;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\platform\threading;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\platform\threading\win;..\..\..\SkypeKit\SDK\ipc\cpp;..\..\..\SkypeKit\SDK\ipc\cpp\VideoBuffers;..\..\..\SkypeKit\SDK\ipc\cpp\platform\se;..\..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\include;..\..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\include\openssl;..\..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\ctaocrypt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <StringPooling>false</StringPooling>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib;$(SolutionDir)..\..\SkypeKit\SDK\lib\Debug</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib.lib;skypekit-cppwrapper_2_lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>
@@ -88,7 +144,33 @@ <RandomizedBaseAddress>false</RandomizedBaseAddress>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
<AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib.lib;skypekit-cppwrapper_2_lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)\lib;$(SolutionDir)..\..\SkypeKit\SDK\lib\Release</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib;$(SolutionDir)..\..\SkypeKit\SDK\lib\Release</AdditionalLibraryDirectories>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ </Link>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;SKYPE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\include;..\..\plugins\ExternalAPI;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\api;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\ipc;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\types;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\platform\threading;..\..\..\SkypeKit\SDK\interfaces\skype\cpp_embedded\src\platform\threading\win;..\..\..\SkypeKit\SDK\ipc\cpp;..\..\..\SkypeKit\SDK\ipc\cpp\VideoBuffers;..\..\..\SkypeKit\SDK\ipc\cpp\platform\se;..\..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\include;..\..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\include\openssl;..\..\..\SkypeKit\SDK\ipc\cpp\ssl\cyassl\ctaocrypt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
+ <AdditionalDependencies>Shlwapi.lib;Ws2_32.lib;Advapi32.lib;skypekit-cyassl_lib.lib;skypekit-cppwrapper_2_lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin10\lib;$(SolutionDir)..\..\SkypeKit\SDK\lib\Release</AdditionalLibraryDirectories>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
</Link>
<ResourceCompile>
diff --git a/protocols/Skype/src/skype.cpp b/protocols/Skype/src/skype.cpp index 9036db259b..6e953ac747 100644 --- a/protocols/Skype/src/skype.cpp +++ b/protocols/Skype/src/skype.cpp @@ -152,8 +152,10 @@ char* LoadKeyPair() aes_set_key( &ctx, tmpK, 128); int dwResSize = SizeofResource(g_hInstance, hRes);
char *pData = (char*)GlobalLock(hResource);
- pData[dwResSize] = 0;
- int basedecoded = decodeSize(pData);
+ char *pCopy = (char*)_alloca(dwResSize+1);
+ memcpy(pCopy, pData, dwResSize);
+ pCopy[dwResSize] = 0;
+ int basedecoded = decodeSize(pCopy);
GlobalUnlock(hResource);
unsigned char *bufD = (unsigned char*)mir_alloc(basedecoded + 1);
unsigned char *tmpD = (unsigned char*)mir_alloc(basedecoded + 1);
diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index dc227e98ba..ae73b7bb17 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -664,10 +664,10 @@ void __cdecl CSkypeProto::LoadContactList(void*) (CContactGroup::OnContactListChanged)&CSkypeProto::OnContactListChanged,
this);
this->commonList->GetContacts(this->contactList);
- Sid::fetch(this->contactList);
+ Sid::fetch(this->contactList);
- for (unsigned int i = 0; i < this->contactList.size(); i++)
- {
+ for (unsigned int i = 0; i < this->contactList.size(); i++)
+ {
CContact::Ref contact = this->contactList[i];
contact->SetOnContactChangedCallback(
(CContact::OnContactChanged)&CSkypeProto::OnContactChanged,
diff --git a/protocols/Skype/src/skype_dialogs.cpp b/protocols/Skype/src/skype_dialogs.cpp index fa15d819c9..4148d30ad6 100644 --- a/protocols/Skype/src/skype_dialogs.cpp +++ b/protocols/Skype/src/skype_dialogs.cpp @@ -17,12 +17,11 @@ INT_PTR CALLBACK CSkypeProto::SkypeAccountProc(HWND hwnd, UINT message, WPARAM w SetDlgItemText(hwnd, IDC_SL, sid);
::mir_free(sid);
- wchar_t* pwd = proto->GetDecodeSettingString(SKYPE_SETTINGS_PASSWORD);
- SetDlgItemText(hwnd, IDC_PW, pwd);
+ char* pwd = proto->GetDecodeSettingString(NULL, SKYPE_SETTINGS_PASSWORD);
+ SetDlgItemTextA(hwnd, IDC_PW, pwd);
::mir_free(pwd);
- if ( proto->m_iStatus != ID_STATUS_OFFLINE)
- {
+ if ( proto->m_iStatus != ID_STATUS_OFFLINE) {
SendMessage(GetDlgItem(hwnd, IDC_SL), EM_SETREADONLY, 1, 0);
SendMessage(GetDlgItem(hwnd, IDC_PW), EM_SETREADONLY, 1, 0);
}
@@ -33,8 +32,7 @@ INT_PTR CALLBACK CSkypeProto::SkypeAccountProc(HWND hwnd, UINT message, WPARAM w {
if (HIWORD(wparam) == EN_CHANGE && reinterpret_cast<HWND>(lparam) == GetFocus())
{
- switch(LOWORD(wparam))
- {
+ switch(LOWORD(wparam)) {
case IDC_SL:
case IDC_PW:
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
@@ -45,18 +43,20 @@ INT_PTR CALLBACK CSkypeProto::SkypeAccountProc(HWND hwnd, UINT message, WPARAM w case WM_NOTIFY:
{
- if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY)
- {
- TCHAR data[128];
+ if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY) {
proto = reinterpret_cast<CSkypeProto*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
-
- ::mir_free(proto->login);
- GetDlgItemText(hwnd, IDC_SL, data, sizeof(data));
- proto->SetSettingString(SKYPE_SETTINGS_LOGIN, data);
- proto->login = ::mir_wstrdup(data);
-
- GetDlgItemText(hwnd, IDC_PW, data, sizeof(data));
- proto->SetDecodeSettingString(SKYPE_SETTINGS_PASSWORD, data);
+ {
+ TCHAR data[128];
+ ::mir_free(proto->login);
+ GetDlgItemText(hwnd, IDC_SL, data, SIZEOF(data));
+ proto->SetSettingString(SKYPE_SETTINGS_LOGIN, data);
+ proto->login = ::mir_wstrdup(data);
+ }
+ {
+ char data[128];
+ GetDlgItemTextA(hwnd, IDC_PW, data, sizeof(data));
+ proto->SetDecodeSettingString(NULL, SKYPE_SETTINGS_PASSWORD, data);
+ }
proto->SetSettingByte("RememberPassword", true);
@@ -77,63 +77,65 @@ INT_PTR CALLBACK CSkypeProto::SkypeOptionsProc(HWND hwnd, UINT message, WPARAM w switch (message)
{
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwnd);
-
- proto = reinterpret_cast<CSkypeProto*>(lparam);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
-
- wchar_t* data = proto->GetSettingString(SKYPE_SETTINGS_LOGIN, L"");
- SetDlgItemText(hwnd, IDC_SL, data);
- ::mir_free(data);
+ {
+ TranslateDialogDefault(hwnd);
- data = proto->GetDecodeSettingString(SKYPE_SETTINGS_PASSWORD, L"");
- SetDlgItemText(hwnd, IDC_PW, data);
- ::mir_free(data);
+ proto = reinterpret_cast<CSkypeProto*>(lparam);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, lparam);
+ {
+ wchar_t* data = proto->GetSettingString(SKYPE_SETTINGS_LOGIN, L"");
+ SetDlgItemText(hwnd, IDC_SL, data);
+ ::mir_free(data);
+ }
+ {
+ char *data = proto->GetDecodeSettingString(NULL, SKYPE_SETTINGS_PASSWORD, "");
+ SetDlgItemTextA(hwnd, IDC_PW, data);
+ ::mir_free(data);
+ }
- if (proto->m_iStatus != ID_STATUS_OFFLINE)
- {
- SendMessage(GetDlgItem(hwnd, IDC_SL), EM_SETREADONLY, 1, 0);
- SendMessage(GetDlgItem(hwnd, IDC_PW), EM_SETREADONLY, 1, 0);
+ if (proto->m_iStatus != ID_STATUS_OFFLINE) {
+ SendMessage(GetDlgItem(hwnd, IDC_SL), EM_SETREADONLY, 1, 0);
+ SendMessage(GetDlgItem(hwnd, IDC_PW), EM_SETREADONLY, 1, 0);
+ }
}
- }
- return TRUE;
+ return TRUE;
case WM_COMMAND:
- {
- if (HIWORD(wparam) == EN_CHANGE && reinterpret_cast<HWND>(lparam) == GetFocus())
{
- switch(LOWORD(wparam))
+ if (HIWORD(wparam) == EN_CHANGE && reinterpret_cast<HWND>(lparam) == GetFocus())
{
- case IDC_SL:
- case IDC_PW:
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ switch(LOWORD(wparam))
+ {
+ case IDC_SL:
+ case IDC_PW:
+ SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
+ }
}
}
- }
- break;
+ break;
case WM_NOTIFY:
- {
if (reinterpret_cast<NMHDR*>(lparam)->code == PSN_APPLY)
{
- wchar_t data[128];
proto = reinterpret_cast<CSkypeProto*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
-
- ::mir_free(proto->login);
- GetDlgItemText(hwnd, IDC_SL, data, sizeof(data));
- proto->SetSettingString(SKYPE_SETTINGS_LOGIN, data);
- proto->login = ::mir_wstrdup(data);
-
- GetDlgItemText(hwnd, IDC_PW, data, sizeof(data));
- proto->SetDecodeSettingString(SKYPE_SETTINGS_PASSWORD, data);
+ {
+ wchar_t data[128];
+ ::mir_free(proto->login);
+ GetDlgItemText(hwnd, IDC_SL, data, SIZEOF(data));
+ proto->SetSettingString(SKYPE_SETTINGS_LOGIN, data);
+ proto->login = ::mir_wstrdup(data);
+ }
+ {
+ char data[128];
+ GetDlgItemTextA(hwnd, IDC_PW, data, sizeof(data));
+ proto->SetDecodeSettingString(NULL, SKYPE_SETTINGS_PASSWORD, data);
+ }
proto->SetSettingByte("RememberPassword", true);
return TRUE;
}
- }
- break;
+ break;
}
return FALSE;
@@ -184,9 +186,9 @@ INT_PTR CALLBACK CSkypeProto::SkypePasswordProc(HWND hwndDlg, UINT msg, WPARAM w ppro->SetSettingByte("RememberPassword", ppro->rememberPassword);
::mir_free(ppro->password);
- wchar_t password[SKYPE_PASSWORD_LIMIT];
- ::GetDlgItemText(hwndDlg, IDC_PASSWORD, password, sizeof(password));
- ppro->password = ::mir_wstrdup(password);
+ char password[SKYPE_PASSWORD_LIMIT];
+ ::GetDlgItemTextA(hwndDlg, IDC_PASSWORD, password, sizeof(password));
+ ppro->password = ::mir_strdup(password);
ppro->SignIn(false);
@@ -205,7 +207,7 @@ INT_PTR CALLBACK CSkypeProto::SkypePasswordProc(HWND hwndDlg, UINT msg, WPARAM w return FALSE;
}
-int __cdecl CSkypeProto::OnAccountManagerInit(WPARAM wParam, LPARAM lParam)
+INT_PTR __cdecl CSkypeProto::OnAccountManagerInit(WPARAM wParam, LPARAM lParam)
{
return (int)CreateDialogParam(
g_hInstance,
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index 88ba779150..1ca8720ea3 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -196,6 +196,7 @@ HANDLE __cdecl CSkypeProto::SearchByEmail(const TCHAR* email) return (HANDLE)SKYPE_SEARCH_BYEMAIL;
}
+
HANDLE __cdecl CSkypeProto::SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName)
{
PROTOSEARCHRESULT isr = {0};
@@ -209,6 +210,7 @@ HANDLE __cdecl CSkypeProto::SearchByName(const TCHAR* nick, const TCHAR* firstNa return (HANDLE)SKYPE_SEARCH_BYNAMES;
}
+
HWND __cdecl CSkypeProto::SearchAdvanced( HWND owner ) { return 0; }
HWND __cdecl CSkypeProto::CreateExtendedSearchUI( HWND owner ){ return 0; }
@@ -261,11 +263,9 @@ int CSkypeProto::SetStatus(int new_status) int old_status = this->m_iStatus;
this->m_iDesiredStatus = new_status;
- switch (new_status)
- {
+ switch (new_status) {
case ID_STATUS_OFFLINE:
- if ( this->account->IsOnline())
- {
+ if (this->account->IsOnline()) {
this->account->SetAvailability(CContact::OFFLINE);
this->account->Logout(true);
this->account->BlockWhileLoggingOut();
@@ -295,8 +295,7 @@ int CSkypeProto::SetStatus(int new_status) }
this->SetSettingWord("Status", this->m_iStatus);
- this->SendBroadcastAsync(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, this->m_iStatus);
-
+ this->SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, this->m_iStatus);
return 0;
}
@@ -347,53 +346,29 @@ int __cdecl CSkypeProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPA void __cdecl CSkypeProto::SignInAsync(void*)
{
- //WaitForSingleObject(&this->signin_lock, INFINITE);
-
- this->account->LoginWithPassword(::mir_u2a(this->password), false, false);
+ this->account.fetch();
+ this->account->LoginWithPassword(this->password, false, false);
this->account->BlockWhileLoggingIn();
if ( !this->rememberPassword)
- {
- for (int i = ::wcslen(this->password); i >= 0; i--)
- this->password[i] = L'\0';
- }
+ memset(this->password, 0, strlen(this->password));
- if (this->account->isLoggedOut)
- {
+ if (this->account->isLoggedOut) {
this->m_iStatus = ID_STATUS_OFFLINE;
- this->SendBroadcast(
- ACKTYPE_LOGIN,
- ACKRESULT_FAILED,
- NULL,
- this->SkypeToMirandaLoginError(this->account->logoutReason));
- this->ShowNotification(
- NULL,
- ::mir_a2u(this->account->logoutReasonString));
+ this->SendBroadcast(ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, this->SkypeToMirandaLoginError(this->account->logoutReason));
+ this->ShowNotification(NULL, ::mir_a2u(this->account->logoutReasonString));
+ return;
}
- else
- {
- g_skype->GetConversationList(g_skype->inbox, CConversation::INBOX_CONVERSATIONS);
- fetch(g_skype->inbox);
- g_skype->SetOnConversationAddedCallback(
- (CSkype::OnConversationAdded)&CSkypeProto::OnConversationAdded, this);
- for (uint i = 0 ; i < g_skype->inbox.size(); i++)
- {
- g_skype->inbox[i]->SetOnMessageReceivedCallback(
- (CConversation::OnMessageReceived)&CSkypeProto::OnOnMessageReceived, this);
- }
- this->SetStatus(this->m_iDesiredStatus);
- this->ForkThread(&CSkypeProto::LoadContactList, this);
- //this->LoadContactList(this);
-
- /*this->account.fetch();
- this->account->SetOnAccountChangedCallback(
- (CAccount::OnAccountChanged)&CSkypeProto::OnAccountChanged, this);*/
+ g_skype->GetConversationList(g_skype->inbox, CConversation::INBOX_CONVERSATIONS);
+ fetch(g_skype->inbox);
+ g_skype->SetOnConversationAddedCallback((CSkype::OnConversationAdded)&CSkypeProto::OnConversationAdded, this);
+ for (uint i = 0 ; i < g_skype->inbox.size(); i++)
+ g_skype->inbox[i]->SetOnMessageReceivedCallback((CConversation::OnMessageReceived)&CSkypeProto::OnOnMessageReceived, this);
- this->ForkThread(&CSkypeProto::LoadOwnInfo, this);
- //this->LoadOwnInfo(this);
- }
+ this->SetStatus(this->m_iDesiredStatus);
- //ReleaseMutex(this->signin_lock);
+ this->LoadContactList(this);
+ this->LoadOwnInfo(this);
}
bool CSkypeProto::SignIn(bool isReadPassword)
@@ -410,15 +385,13 @@ bool CSkypeProto::SignIn(bool isReadPassword) }
else if (g_skype->GetAccount(::mir_u2a(this->login), this->account))
{
- /*this->m_iStatus = ID_STATUS_CONNECTING;
- this->SendBroadcast(ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_OFFLINE, this->m_iStatus); */
if (isReadPassword)
- this->password = this->GetDecodeSettingString(SKYPE_SETTINGS_PASSWORD);
- if (::wcscmp(this->password, L"") == 0)
+ this->password = this->GetDecodeSettingString(NULL, SKYPE_SETTINGS_PASSWORD);
+ if ( !::strcmp(this->password, ""))
this->RequestPassword();
else
{
- this->ForkThread(&CSkypeProto::SignInAsync, this);
+ this->ForkThread(&CSkypeProto::SignInAsync, 0);
//this->SignInAsync(this);
return true;
}
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index 0d3f2669ad..4de33f6dcc 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -125,7 +125,7 @@ public: int __cdecl OnContactDeleted(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
int __cdecl OnUserInfoInit(WPARAM, LPARAM);
- int __cdecl OnAccountManagerInit(WPARAM wParam, LPARAM lParam);
+ INT_PTR __cdecl OnAccountManagerInit(WPARAM wParam, LPARAM lParam);
// instances
static CSkypeProto* InitSkypeProto(const char* protoName, const wchar_t* userName);
@@ -154,7 +154,7 @@ protected: CContactGroup::Ref authWaitList;
wchar_t *login;
- wchar_t *password;
+ char *password;
bool rememberPassword;
void RequestPassword();
@@ -275,10 +275,10 @@ protected: // services
static LIST<void> serviceList;
- int __cdecl GetAvatarInfo(WPARAM, LPARAM);
- int __cdecl GetAvatarCaps(WPARAM, LPARAM);
- int __cdecl GetMyAvatar(WPARAM, LPARAM);
- int __cdecl SetMyAvatar(WPARAM, LPARAM);
+ INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM);
+ INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM);
+ INT_PTR __cdecl GetMyAvatar(WPARAM, LPARAM);
+ INT_PTR __cdecl SetMyAvatar(WPARAM, LPARAM);
// icons
static _tag_iconList iconList[];
@@ -316,8 +316,7 @@ protected: DWORD GetSettingDword(HANDLE hContact, const char *setting, DWORD errorValue = 0);
wchar_t* GetSettingString(const char *setting, wchar_t* errorValue = NULL);
wchar_t* GetSettingString(HANDLE hContact, const char *setting, wchar_t* errorValue = NULL);
- wchar_t* GetDecodeSettingString(const char *setting, wchar_t* errorValue = NULL);
- wchar_t* GetDecodeSettingString(HANDLE hContact, const char *setting, wchar_t* errorValue = NULL);
+ char* GetDecodeSettingString(HANDLE hContact, const char *setting, char* errorValue = NULL);
//
bool SetSettingByte(const char *setting, BYTE value);
bool SetSettingByte(HANDLE hContact, const char *setting, BYTE value);
@@ -327,8 +326,7 @@ protected: bool SetSettingDword(HANDLE hContact, const char *setting, DWORD value);
bool SetSettingString(const char *setting, const wchar_t* value);
bool SetSettingString(HANDLE hContact, const char *setting, const wchar_t* value);
- bool SetDecodeSettingString(const char *setting, const wchar_t* value);
- bool SetDecodeSettingString(HANDLE hContact, const char *setting, const wchar_t* value);
+ bool SetDecodeSettingString(HANDLE hContact, const char *setting, const char* value);
//
void DeleteSetting(const char *setting);
void DeleteSetting(HANDLE hContact, const char *setting);
diff --git a/protocols/Skype/src/skype_services.cpp b/protocols/Skype/src/skype_services.cpp index 314a286d2c..d5d1eefc52 100644 --- a/protocols/Skype/src/skype_services.cpp +++ b/protocols/Skype/src/skype_services.cpp @@ -8,7 +8,7 @@ void CSkypeProto::InitServiceList() ::CreateServiceFunction("Skype/MenuChoose", CSkypeProto::MenuChooseService));
}
-int __cdecl CSkypeProto::GetAvatarInfo(WPARAM, LPARAM lParam)
+INT_PTR __cdecl CSkypeProto::GetAvatarInfo(WPARAM, LPARAM lParam)
{
PROTO_AVATAR_INFORMATIONW *pai = (PROTO_AVATAR_INFORMATIONW*)lParam;
@@ -32,7 +32,7 @@ int __cdecl CSkypeProto::GetAvatarInfo(WPARAM, LPARAM lParam) return GAIR_NOAVATAR;
}
-int __cdecl CSkypeProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam)
+INT_PTR __cdecl CSkypeProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam)
{
switch (wParam)
{
@@ -76,7 +76,7 @@ int __cdecl CSkypeProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam) return 0;
}
-int __cdecl CSkypeProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
+INT_PTR __cdecl CSkypeProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
{
if (!wParam) return -2;
@@ -92,7 +92,7 @@ int __cdecl CSkypeProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) return -1;
}
-int __cdecl CSkypeProto::SetMyAvatar(WPARAM, LPARAM lParam)
+INT_PTR __cdecl CSkypeProto::SetMyAvatar(WPARAM, LPARAM lParam)
{
wchar_t *path = (wchar_t *)lParam;
int iRet = -1;
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"");
}
//
diff --git a/protocols/Skype/src/skype_subclassing.cpp b/protocols/Skype/src/skype_subclassing.cpp index 0058f0a5a5..5e63c5d553 100644 --- a/protocols/Skype/src/skype_subclassing.cpp +++ b/protocols/Skype/src/skype_subclassing.cpp @@ -117,8 +117,7 @@ void CAccount::BlockWhileLoggingOut() bool CAccount::IsOnline()
{
- return this->isLoggedIn;
- //(CAccount::STATUS)this->GetUintProp(CAccount::P_STATUS) == Account::LOGGED_IN;
+ return (this == NULL) ? false : this->isLoggedIn;
}
// CContactGroup
diff --git a/protocols/Skype/src/skype_utils.cpp b/protocols/Skype/src/skype_utils.cpp index bfe155178e..ea4b8f3d1e 100644 --- a/protocols/Skype/src/skype_utils.cpp +++ b/protocols/Skype/src/skype_utils.cpp @@ -342,8 +342,7 @@ void CSkypeProto::HookEvent(const char* szEvent, SkypeEventFunc handler) int CSkypeProto::SendBroadcast(HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam)
{
- ACKDATA ack = {0};
- ack.cbSize = sizeof(ACKDATA);
+ ACKDATA ack = { sizeof(ACKDATA) };
ack.szModule = this->m_szModuleName;
ack.hContact = hContact;
ack.type = type;
@@ -422,16 +421,12 @@ void CSkypeProto::ShowNotification(const wchar_t *sid, const wchar_t *message, i {
if (::Miranda_Terminated()) return;
- if ( !ServiceExists(MS_POPUP_ADDPOPUPEX) || !DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) )
- {
- MessageBoxW(
- NULL,
- message,
- TranslateT("Skype Protocol"),
- MB_OK);
- }
- else
- {
+ if ( !ServiceExists(MS_POPUP_ADDPOPUPEX) || !DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1))
+ MessageBoxW(NULL, message, TranslateT("Skype Protocol"), MB_OK);
+ else {
+ if ( !sid)
+ sid = L"";
+
POPUPDATAT_V2 ppd = {0};
ppd.cbSize = sizeof(POPUPDATAT_V2);
ppd.lchContact = NULL;
|