From 578c3d4a75046cc06dfa247b437f04fc542c36a9 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 28 Dec 2012 20:34:31 +0000 Subject: - added password changing git-svn-id: http://svn.miranda-ng.org/main/trunk@2875 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_proto.cpp | 58 ++----------------------------------- 1 file changed, 2 insertions(+), 56 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 48a32e32db..907a36047a 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -267,7 +267,7 @@ int CSkypeProto::SetStatus(int new_status) switch (new_status) { case ID_STATUS_OFFLINE: - if (this->IsOnline()) + if (this->IsOnline() || this->m_iStatus == ID_STATUS_CONNECTING) { this->account->SetAvailability(CContact::OFFLINE); this->account->Logout(true); @@ -281,7 +281,7 @@ int CSkypeProto::SetStatus(int new_status) if (old_status == ID_STATUS_OFFLINE && !this->IsOnline()) { this->m_iStatus = ID_STATUS_CONNECTING; - if ( !this->SignIn()) return 0; + if ( !this->SignIn(this->m_iDesiredStatus)) return 0; } else { @@ -351,58 +351,4 @@ int __cdecl CSkypeProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPA } return 1; -} - -void __cdecl CSkypeProto::SignInAsync(void*) -{ - this->LoadOwnInfo(this); - this->LoadContactList(this); -} - -bool CSkypeProto::SignIn(bool isReadPassword) -{ - if ( !this->login || !::strlen(this->login)) - { - this->m_iStatus = ID_STATUS_OFFLINE; - this->SendBroadcast(ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID); - this->ShowNotification( - TranslateT("You have not entered a Skype name.\n\ - Configure this in Options->Network->Skype and try again.")); - } - else if (this->skype->GetAccount(this->login, this->account)) - { - if (isReadPassword) - this->password = this->GetDecodeSettingString(NULL, SKYPE_SETTINGS_PASSWORD); - if ( !this->password || !::strlen(this->password)) - this->RequestPassword(); - else - { - this->account.fetch(); - this->account->SetOnAccountChangedCallback( - (CAccount::OnAccountChanged)&CSkypeProto::OnAccountChanged, - this); - // - int port; - this->skype->GetInt(SETUPKEY_PORT, port); - this->skype->SetInt(SETUPKEY_PORT, this->GetSettingWord("Port", port)); - this->skype->SetInt(SETUPKEY_DISABLE_PORT80, (int)!this->GetSettingByte("UseAlternativePorts", 1)); - // - this->InitProxy(); - // - this->account->LoginWithPassword(this->password, false, false); - return true; - } - } - - return false; -} - -void CSkypeProto::RequestPassword() -{ - ::DialogBoxParam( - g_hInstance, - MAKEINTRESOURCE(IDD_PASSWORDREQUEST), - NULL, - CSkypeProto::SkypePasswordProc, - LPARAM(this)); } \ No newline at end of file -- cgit v1.2.3