diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-02-20 05:59:02 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-02-20 05:59:02 +0000 |
commit | ed8f4de7d05024cf21f332bafae17cd9d13e5f61 (patch) | |
tree | 0e60a6b4f4883ac5b5cf694319fab12583d058bc /protocols/VKontakte/src/vk_thread.cpp | |
parent | ce36763ef06b7c579b2f447386985f6d2783efc9 (diff) |
VKontakte:
fix for notification filters
move account.setOnline from SetServerStatus to RetrieveUsersInfo
git-svn-id: http://svn.miranda-ng.org/main/trunk@12212 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index cc032a8d57..43e5416ca2 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -114,6 +114,7 @@ void CVkProto::SetServerStatus(int iNewStatus) ptrT ptszListeningToMsg(db_get_tsa(NULL, m_szModuleName, "ListeningTo"));
if (iNewStatus == ID_STATUS_OFFLINE) {
+ m_bNeedSendOnline = false;
if (!IsEmpty(ptszListeningToMsg) && m_bSetBroadcast) {
RetrieveStatusMsg(oldStatusMsg);
m_bSetBroadcast = false;
@@ -124,11 +125,15 @@ void CVkProto::SetServerStatus(int iNewStatus) << VER_API);
}
else if (iNewStatus != ID_STATUS_INVISIBLE) {
+ m_bNeedSendOnline = true;
+ if (iOldStatus == ID_STATUS_ONLINE)
+ return;
m_iStatus = ID_STATUS_ONLINE;
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOnline.json", true, &CVkProto::OnReceiveSmth)
<< VER_API);
}
else {
+ m_bNeedSendOnline = false;
if (!IsEmpty(ptszListeningToMsg) && m_bSetBroadcast) {
RetrieveStatusMsg(oldStatusMsg);
m_bSetBroadcast = false;
@@ -424,6 +429,10 @@ void CVkProto::RetrieveUsersInfo(bool flag) }
CMString codeformat("var userIDs=\"%s\";");
+
+ if (m_bNeedSendOnline)
+ codeformat += _T("API.account.setOnline();");
+
if (flag)
codeformat += CMString("var US=API.users.get({\"user_ids\":userIDs,\"fields\":\"%s\",\"name_case\":\"nom\"});"
"var res=[];var index=US.length;while(index >0){index=index-1;if(US[index].online==1){res.unshift(US[index]);};};"
|