diff options
author | ElzorFox <elzorfox@ya.ru> | 2016-11-20 20:17:09 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2016-11-20 20:17:09 +0500 |
commit | 21b895b97019d918ede01ca6d7c190c8591160eb (patch) | |
tree | 2f45f1a8ce6d4127923a24d856f5f2bfcd5f767e /protocols/VKontakte/src/vk_thread.cpp | |
parent | 79a9da0f87d91c8f44abfa571a0e017bda3d6195 (diff) |
VKontakte:
optimize loading user status info
version bump
Diffstat (limited to 'protocols/VKontakte/src/vk_thread.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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]);};};"
|