From 39599842d91d490fe82ae8f97ea17e91859b2556 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 21 Jun 2013 07:50:13 +0000 Subject: fixed contacts status change popups when you goes offline git-svn-id: http://svn.miranda-ng.org/main/trunk@5074 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_account.cpp | 10 ++------- protocols/Skype/src/skype_proto.cpp | 40 +++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 22 deletions(-) (limited to 'protocols/Skype') diff --git a/protocols/Skype/src/skype_account.cpp b/protocols/Skype/src/skype_account.cpp index f6b91dd8f4..ca4f38b4ac 100644 --- a/protocols/Skype/src/skype_account.cpp +++ b/protocols/Skype/src/skype_account.cpp @@ -129,12 +129,6 @@ void CSkypeProto::LogOut() this->account->SetAvailability(Contact::OFFLINE); this->Log(L"Logout from account"); this->account->Logout(true); - - if ( !::Miranda_Terminated()) - { - this->SetAllContactStatus(ID_STATUS_OFFLINE); - this->CloseAllChatSessions(); - } } } @@ -166,7 +160,7 @@ void CSkypeProto::InitProxy() NETLIBUSERSETTINGS nlus = { sizeof(NETLIBUSERSETTINGS) }; ::CallService(MS_NETLIB_GETUSERSETTINGS, (WPARAM)this->hNetLibUser, (LPARAM)&nlus); - if (nlus.useProxy) + if (nlus.useProxy) { char address[MAX_PATH]; ::mir_snprintf(address, MAX_PATH, "%s:%d", nlus.szProxyServer, nlus.wProxyPort); @@ -197,7 +191,7 @@ void CSkypeProto::InitProxy() { this->SetStr(SETUPKEY_SOCKS_PROXY_USER, nlus.szProxyAuthUser); ptrA encodedPass(::mir_base64_encode((BYTE*)nlus.szProxyAuthPassword, ::lstrlenA(nlus.szProxyAuthPassword))); - this->SetStr(SETUPKEY_SOCKS_PROXY_PWD, (char*)encodedPass); + this->SetStr(SETUPKEY_SOCKS_PROXY_PWD, (char*)encodedPass); } break; diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index 68f55adb90..b82cc174aa 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -437,21 +437,21 @@ int __cdecl CSkypeProto::SetApparentMode(HANDLE hContact, int mode) { return 0; int CSkypeProto::SetStatus(int new_status) { - switch (new_status) + switch (new_status) { - case ID_STATUS_OCCUPIED: - new_status = ID_STATUS_DND; + case ID_STATUS_OCCUPIED: + new_status = ID_STATUS_DND; break; - case ID_STATUS_FREECHAT: - new_status = ID_STATUS_ONLINE; + case ID_STATUS_FREECHAT: + new_status = ID_STATUS_ONLINE; break; - case ID_STATUS_ONTHEPHONE: - case ID_STATUS_OUTTOLUNCH: - case ID_STATUS_NA: - new_status = ID_STATUS_AWAY; + case ID_STATUS_ONTHEPHONE: + case ID_STATUS_OUTTOLUNCH: + case ID_STATUS_NA: + new_status = ID_STATUS_AWAY; break; } - + if (new_status == this->m_iDesiredStatus) return 0; @@ -462,23 +462,35 @@ int CSkypeProto::SetStatus(int new_status) { this->LogOut(); this->m_iStatus = this->m_iDesiredStatus = ID_STATUS_OFFLINE; + + this->SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); + + if ( !::Miranda_Terminated()) + { + this->SetAllContactStatus(ID_STATUS_OFFLINE); + this->CloseAllChatSessions(); + } + + return 0; } else { if (old_status == ID_STATUS_OFFLINE && !this->IsOnline()) { this->m_iStatus = ID_STATUS_CONNECTING; - if ( !this->LogIn()) + if ( !this->LogIn()) return 0; } else { - if ( this->account->IsOnline()) { + if ( this->account->IsOnline()) + { SetServerStatus(new_status); return 0; } - - SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); + + this->SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); + return 0; } } -- cgit v1.2.3