diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-05-15 19:35:37 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-05-15 19:35:37 +0000 |
commit | 2041c4ed0d7d0dfc7a4035451e5d12c1fd45c6aa (patch) | |
tree | be2c57f3c15b1d03d5e8cf4ab6af476f527957b6 /plugins/Dropbox/src | |
parent | 40d67616137486f6e666e451ef47e4b37b408c86 (diff) |
Dropbox: fixed contact status
git-svn-id: http://svn.miranda-ng.org/main/trunk@13608 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src')
-rw-r--r-- | plugins/Dropbox/src/dropbox.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp index a370c7e559..9ef7f27a64 100644 --- a/plugins/Dropbox/src/dropbox.cpp +++ b/plugins/Dropbox/src/dropbox.cpp @@ -47,13 +47,11 @@ MCONTACT CDropbox::GetDefaultContact() db_set_s(NULL, MODULE, "Nick", MODULE);
db_set_s(hDefaultContact, MODULE, "Nick", MODULE);
db_set_ws(hDefaultContact, "CList", "MyHandle", L"Dropbox");
-
- int status = db_get_w(hDefaultContact, MODULE, "Status", ID_STATUS_OFFLINE);
- if (HasAccessToken() && status == ID_STATUS_OFFLINE)
- db_set_w(hDefaultContact, MODULE, "Status", ID_STATUS_ONLINE);
}
}
+ db_set_w(hDefaultContact, MODULE, "Status", HasAccessToken() ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE);
+
return hDefaultContact;
}
@@ -139,7 +137,7 @@ void CDropbox::DestroyAccessToken() db_unset(NULL, MODULE, "TokenSecret");
MCONTACT hContact = CDropbox::GetDefaultContact();
if (hContact)
- if (db_get_w(hContact, MODULE, "Status", ID_STATUS_ONLINE) == ID_STATUS_ONLINE)
+ if (db_get_w(hContact, MODULE, "Status", ID_STATUS_ONLINE) != ID_STATUS_OFFLINE)
db_set_w(hContact, MODULE, "Status", ID_STATUS_OFFLINE);
ProtoBroadcastAck(MODULE, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_ONLINE, (WPARAM)ID_STATUS_OFFLINE);
@@ -194,7 +192,7 @@ UINT CDropbox::RequestAccessTokenAsync(void *owner, void *param) MCONTACT hContact = instance->GetDefaultContact();
if (hContact)
{
- if (db_get_w(hContact, MODULE, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
+ if (db_get_w(hContact, MODULE, "Status", ID_STATUS_OFFLINE) != ID_STATUS_ONLINE)
db_set_w(hContact, MODULE, "Status", ID_STATUS_ONLINE);
}
|