summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_proto.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-10-21 08:08:45 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-10-21 08:08:45 +0000
commit537cc1ec9cdd43257b19385acacd05cdace3ac1a (patch)
treeb593f58dc1bd0da4d0bb3ef0218aa726955727eb /protocols/VKontakte/src/vk_proto.cpp
parentf28932a9312ce067782665b9497f8203483d748d (diff)
VKontakte:
add IsOnline() in functions with pushing requests fix(?) for freeze offline status git-svn-id: http://svn.miranda-ng.org/main/trunk@10843 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 45b0f3c0f9..53be268746 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -344,6 +344,8 @@ void CVkProto::SendMsgAck(void *param)
int CVkProto::SendMsg(MCONTACT hContact, int flags, const char *msg)
{
debugLogA("CVkProto::SendMsg");
+ if (!IsOnline())
+ return 0;
LONG userID = getDword(hContact, "ID", -1);
if (userID == -1)
return 0;
@@ -444,8 +446,11 @@ int CVkProto::SetStatus(int iNewStatus)
}
else if (IsOnline())
SetServerStatus(iNewStatus);
- else
+ else {
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ if (!(m_iStatus >= ID_STATUS_CONNECTING && m_iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES))
+ m_iDesiredStatus = m_iStatus;
+ }
return 0;
}
@@ -545,6 +550,8 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *
int CVkProto::Authorize(HANDLE hDbEvent)
{
debugLogA("CVkProto::Authorize");
+ if (!IsOnline())
+ return 1;
MCONTACT hContact = MContactFromDbEvent(hDbEvent);
if (hContact == -1)
return 1;
@@ -555,6 +562,8 @@ int CVkProto::Authorize(HANDLE hDbEvent)
int CVkProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason)
{
debugLogA("CVkProto::AuthDeny");
+ if (!IsOnline())
+ return 1;
MCONTACT hContact = MContactFromDbEvent(hDbEvent);
if (hContact == -1)
return 1;