summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp4
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp6
2 files changed, 8 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index f112ccd4fc..0f671aaa6d 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -183,8 +183,10 @@ int CVkProto::SetStatus(int iNewStatus)
m_iDesiredStatus = iNewStatus;
if (iNewStatus == ID_STATUS_OFFLINE) {
- if ( IsOnline())
+ if ( IsOnline()) {
+ SetServerStatus(ID_STATUS_OFFLINE);
ShutdownSession();
+ }
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 2d71e576c2..bb0bbb844b 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -73,7 +73,11 @@ void CVkProto::OnLoggedOut()
int CVkProto::SetServerStatus(int iStatus)
{
- if (iStatus != ID_STATUS_OFFLINE && iStatus != ID_STATUS_INVISIBLE) {
+ if (iStatus == ID_STATUS_OFFLINE) {
+ HttpParam param = { "access_token", m_szAccessToken };
+ PushAsyncHttpRequest(REQUEST_GET, "/method/account.setOffline.json", true, &CVkProto::OnReceiveSmth, 1, &param);
+ }
+ else if (iStatus != ID_STATUS_INVISIBLE) {
HttpParam param = { "access_token", m_szAccessToken };
PushAsyncHttpRequest(REQUEST_GET, "/method/account.setOnline.json", true, &CVkProto::OnReceiveSmth, 1, &param);
}