From 5e77e8a1665382c76fee1bc3ca12e44aca9af2e7 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Thu, 20 Dec 2012 17:25:21 +0000 Subject: - third approach of group chat support - added connection options - fixed connection via proxy git-svn-id: http://svn.miranda-ng.org/main/trunk@2772 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_proto.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'protocols/Skype/src/skype_proto.cpp') diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index 1e33a9a5a7..54d43d56c9 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -29,6 +29,11 @@ CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) this->InitNetLib(); this->InitCustomFolders(); + + // + g_skype->SetOnMessageCallback( + (CSkype::OnMessaged)&CSkypeProto::OnMessage, + this); } CSkypeProto::~CSkypeProto() @@ -243,7 +248,7 @@ int __cdecl CSkypeProto::SendMsg(HANDLE hContact, int flags, const char* msg) if (conversation) { Message::Ref message; - conversation->PostText(msg, message); + conversation->PostText(::mir_utf8encode(msg), message); } this->SendBroadcastAsync( @@ -358,10 +363,6 @@ int __cdecl CSkypeProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPA void __cdecl CSkypeProto::SignInAsync(void*) { - g_skype->SetOnMessageCallback( - (CSkype::OnMessaged)&CSkypeProto::OnMessage, - this); - this->SetStatus(this->m_iDesiredStatus); this->LoadOwnInfo(this); @@ -393,12 +394,17 @@ bool CSkypeProto::SignIn(bool isReadPassword) (CAccount::OnAccountChanged)&CSkypeProto::OnAccountChanged, this); // + int port; + g_skype->GetInt(SETUPKEY_PORT, port); + g_skype->SetInt(SETUPKEY_PORT, this->GetSettingWord("Port", port)); + g_skype->SetInt(SETUPKEY_DISABLE_PORT80, (int)!this->GetSettingByte("UseAlternativePorts", 1)); + // if (this->hNetlibUser) { NETLIBUSERSETTINGS nlus = { sizeof(NETLIBUSERSETTINGS) }; - if ( - !::CallService(MS_NETLIB_GETUSERSETTINGS, (WPARAM)this->hNetlibUser, (LPARAM)&nlus) && - nlus.useProxy) + ::CallService(MS_NETLIB_GETUSERSETTINGS, (WPARAM)this->hNetlibUser, (LPARAM)&nlus); + + if (nlus.useProxy) { char address[MAX_PATH]; ::mir_snprintf(address, MAX_PATH, "%s:%d", nlus.szProxyServer, nlus.wProxyPort); @@ -413,7 +419,12 @@ bool CSkypeProto::SignIn(bool isReadPassword) if (nlus.useProxyAuth) { g_skype->SetStr(SETUPKEY_HTTPS_PROXY_USER, nlus.szProxyAuthUser); - g_skype->SetStr(SETUPKEY_HTTPS_PROXY_PWD, nlus.szProxyAuthPassword); + + char *encodedPass = new char[MAX_PATH]; + + CSkypeProto::Base64Encode(nlus.szProxyAuthPassword, encodedPass, MAX_PATH); + + g_skype->SetStr(SETUPKEY_HTTPS_PROXY_PWD, encodedPass); } break; -- cgit v1.2.3