summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_account.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-26 20:23:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-26 20:23:31 +0000
commitd3205b4a9cbfe603146a9d2adab6a468424f8f5d (patch)
tree9f4116a133a0a83d3685904b9841242d911a80a5 /protocols/Skype/src/skype_account.cpp
parentbed36b071fe082d34e5961bb5105e662f17aa7c6 (diff)
fix for setting statuses
git-svn-id: http://svn.miranda-ng.org/main/trunk@4540 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_account.cpp')
-rw-r--r--protocols/Skype/src/skype_account.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/protocols/Skype/src/skype_account.cpp b/protocols/Skype/src/skype_account.cpp
index 7396785e7a..44b01e9216 100644
--- a/protocols/Skype/src/skype_account.cpp
+++ b/protocols/Skype/src/skype_account.cpp
@@ -103,7 +103,7 @@ bool CSkypeProto::PreparePassword()
bool CSkypeProto::LogIn()
{
- if (this->IsOnline()|| !this->PrepareLogin())
+ if (this->IsOnline() || !this->PrepareLogin())
return false;
if (g_skype->GetAccount(::mir_u2a(this->login), this->account))
@@ -133,7 +133,6 @@ void CSkypeProto::LogOut()
this->account->SetAvailability(CContact::OFFLINE);
this->account->Logout(true);
- this->m_iStatus = ID_STATUS_OFFLINE;
this->SetAllContactStatus(ID_STATUS_OFFLINE);
}
}
@@ -229,7 +228,26 @@ void CSkypeProto::OnLoggedIn()
fetch(this->transferList);
- this->SetStatus(this->m_iDesiredStatus);
+ this->SetServerStatus(this->m_iDesiredStatus);
+}
+
+void CSkypeProto::SetServerStatus(int iNewStatus)
+{
+ if (!this->account)
+ return;
+
+ // change status
+ if (m_iStatus == iNewStatus)
+ return;
+
+ int oldStatus = m_iStatus;
+ m_iStatus = iNewStatus;
+
+ CContact::AVAILABILITY availability = this->MirandaToSkypeStatus(iNewStatus);
+ if (availability != CContact::UNKNOWN)
+ this->account->SetAvailability(availability);
+
+ this->SendBroadcast(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, this->m_iStatus);
}
void CSkypeProto::OnCblUpdated()