From 4db6c5178cbd85e29e714a63ee5b1e8fc9881bae Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Thu, 27 Sep 2012 05:44:38 +0000 Subject: - added skype sublassing - CSkupeProto funcs moved to spec files - some minor changes git-svn-id: http://svn.miranda-ng.org/main/trunk@1675 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_subclassing.cpp | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 protocols/Skype/src/skype_subclassing.cpp (limited to 'protocols/Skype/src/skype_subclassing.cpp') diff --git a/protocols/Skype/src/skype_subclassing.cpp b/protocols/Skype/src/skype_subclassing.cpp new file mode 100644 index 0000000000..04b4a82b74 --- /dev/null +++ b/protocols/Skype/src/skype_subclassing.cpp @@ -0,0 +1,45 @@ +#include "skype_subclassing.h" + +Account* CSkype::newAccount(int oid) +{ + return new CAccount(oid, this); +} + +CAccount::CAccount(unsigned int oid, SERootObject* root) : Account(oid, root) +{ + this->isLoggedOut = true; +} + +void CAccount::OnChange(int prop) +{ + if (prop == Account::P_STATUS) + { + Account::STATUS loginStatus; + this->GetPropStatus(loginStatus); + if (loginStatus == Account::LOGGED_IN) + this->isLoggedOut = false; + + if (loginStatus == Account::LOGGED_OUT) + { + this->isLoggedOut = true; + Account::LOGOUTREASON whyLogout; + this->GetPropLogoutreason(whyLogout); + /*if (whyLogout != Account::LOGOUT_CALLED) + { + printf("%s\n", (const char*)tostring(whyLogout)); + }*/ + } + } +}; + +void CAccount::BlockWhileLoggingIn() +{ + while (this->isLoggedOut) + Sleep(1); +} + +void CAccount::BlockWhileLoggingOut() +{ + while ( !this->isLoggedOut) + Sleep(1); +}; \ No newline at end of file -- cgit v1.2.3