summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2016-11-20 20:17:09 +0500
committerElzorFox <elzorfox@ya.ru>2016-11-20 20:17:09 +0500
commit21b895b97019d918ede01ca6d7c190c8591160eb (patch)
tree2f45f1a8ce6d4127923a24d856f5f2bfcd5f767e
parent79a9da0f87d91c8f44abfa571a0e017bda3d6195 (diff)
VKontakte:
optimize loading user status info version bump
-rw-r--r--protocols/VKontakte/src/version.h2
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp2
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp8
3 files changed, 9 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index 167af8b3f9..af23f8317a 100644
--- a/protocols/VKontakte/src/version.h
+++ b/protocols/VKontakte/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 2
-#define __BUILD_NUM 8
+#define __BUILD_NUM 9
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index c50f2559a1..e0463a7866 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -357,7 +357,7 @@ void CVkProto::InitMenus()
int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM)
{
LONG userID = getDword(hContact, "ID", VK_INVALID_USER);
- bool bisFriend = (getBool(hContact, "Auth", true) == 0);
+ bool bisFriend = !getBool(hContact, "Auth", true);
bool bisBroadcast = !(IsEmpty(ptrW(db_get_wsa(hContact, m_szModuleName, "AudioUrl"))));
bool bIsGroup = IsGroupUser(hContact);
Menu_ShowItem(m_hContactMenuItems[CMI_VISITPROFILE], userID != VK_FEED_USER);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index d68790ab2b..5a5563f3d8 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -527,6 +527,11 @@ void CVkProto::RetrieveUsersInfo(bool bFreeOffline, bool bRepeat)
LONG userID = getDword(hContact, "ID", VK_INVALID_USER);
if (userID == VK_INVALID_USER || userID == VK_FEED_USER || userID < 0)
continue;
+
+ bool bIsFriend = !getBool(hContact, "Auth", true);
+ if (bFreeOffline && !m_vkOptions.bLoadFullCList && bIsFriend)
+ continue;
+
if (!userIDs.IsEmpty())
userIDs.AppendChar(',');
userIDs.AppendFormat(L"%i", userID);
@@ -542,7 +547,8 @@ void CVkProto::RetrieveUsersInfo(bool bFreeOffline, bool bRepeat)
codeformat += L"API.account.setOnline();";
if (bFreeOffline && !m_vkOptions.bLoadFullCList)
- codeformat += CMStringW("var US=[];var res=[];var t=10;while(t>0){"
+ codeformat += CMStringW("var US=[];var res=API.users.get({\"user_ids\":API.friends.getOnline(),\"fields\":_fields,\"name_case\":\"nom\"});"
+ "var t=10;while(t>0){"
"US=API.users.get({\"user_ids\":userIDs,\"fields\":_fields,\"name_case\":\"nom\"});"
"var index=US.length;while(index>0){"
"index=index-1;if(US[index].online!=0){res.push(US[index]);};};"