From d3205b4a9cbfe603146a9d2adab6a468424f8f5d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 26 Apr 2013 20:23:31 +0000 Subject: fix for setting statuses git-svn-id: http://svn.miranda-ng.org/main/trunk@4540 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_proto.cpp | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 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 ac28c0a6e2..faf7a980e0 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -375,22 +375,7 @@ int __cdecl CSkypeProto::SetApparentMode( HANDLE hContact, int mode ) { retur int CSkypeProto::SetStatus(int new_status) { - /*switch (new_status) - { - case ID_STATUS_OCCUPIED: - new_status = ID_STATUS_DND; - break; - 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; - break; - }*/ - - if (new_status == this->m_iStatus) + if (new_status == this->m_iDesiredStatus) return 0; int old_status = this->m_iStatus; @@ -399,6 +384,8 @@ int CSkypeProto::SetStatus(int new_status) if (new_status == ID_STATUS_OFFLINE) { this->LogOut(); + this->m_iStatus = this->m_iDesiredStatus = ID_STATUS_OFFLINE; + this->SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); } else { @@ -410,20 +397,13 @@ int CSkypeProto::SetStatus(int new_status) } else { - if ( !this->account->IsOnline()) - return 0; - - CContact::AVAILABILITY availability = this->MirandaToSkypeStatus(new_status); - if (availability != CContact::UNKNOWN) - { - this->account->SetAvailability(availability); - this->m_iStatus = new_status; - } + if ( this->account->IsOnline()) + SetServerStatus(new_status); + else + SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); } } - this->SetSettingWord("Status", this->m_iStatus); - this->SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, this->m_iStatus); return 0; } -- cgit v1.2.3