diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2012-12-13 18:29:32 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2012-12-13 18:29:32 +0000 |
commit | 6f291839eda68d23b65604cb5d5c685094072ed5 (patch) | |
tree | 86b7c6af0d480407529f782ede7c648790264378 /protocols/Skype/src/skype_account.cpp | |
parent | b886dbff1977162ea1a6fa000c8275ecdf561e85 (diff) |
- refactored login/logout
git-svn-id: http://svn.miranda-ng.org/main/trunk@2740 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_account.cpp')
-rw-r--r-- | protocols/Skype/src/skype_account.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/protocols/Skype/src/skype_account.cpp b/protocols/Skype/src/skype_account.cpp new file mode 100644 index 0000000000..18505d9af4 --- /dev/null +++ b/protocols/Skype/src/skype_account.cpp @@ -0,0 +1,43 @@ +#include "skype_proto.h"
+
+void CSkypeProto::OnAccountChanged(int prop)
+{
+ switch(prop)
+ {
+ case CAccount::P_STATUS:
+ CAccount::STATUS loginStatus;
+ this->account->GetPropStatus(loginStatus);
+
+ if (loginStatus == CAccount::LOGGED_IN)
+ {
+ this->ForkThread(&CSkypeProto::SignInAsync, 0);
+ //this->SignInAsync(this);
+ }
+
+ if ((loginStatus == CAccount::LOGGED_OUT || loginStatus == CAccount::LOGGED_OUT_AND_PWD_SAVED))
+ {
+ CAccount::LOGOUTREASON whyLogout;
+ this->account->GetPropLogoutreason(whyLogout);
+ if (whyLogout != CAccount::LOGOUT_CALLED)
+ {
+ this->m_iStatus = ID_STATUS_OFFLINE;
+ this->SendBroadcast(
+ ACKTYPE_LOGIN,
+ ACKRESULT_FAILED,
+ NULL,
+ this->SkypeToMirandaLoginError(whyLogout));
+
+ this->ShowNotification(NULL, CSkypeProto::LogoutReasons[whyLogout - 1]);
+ }
+ }
+ break;
+
+ default :
+ OnProfileChanged(prop);
+ }
+}
+
+bool CSkypeProto::IsOnline()
+{
+ return this->m_iStatus > ID_STATUS_OFFLINE;
+}
\ No newline at end of file |