From 0e015080019d3a9d6f75efde41a7c654491f5db2 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Mon, 8 Feb 2016 03:33:39 +0000 Subject: VKontakte: fix(?) vk error 13 on RetrieveUsersInfo git-svn-id: http://svn.miranda-ng.org/main/trunk@16245 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_proto.h | 1 + protocols/VKontakte/src/vk_thread.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index e536536245..4ac93491ed 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -40,6 +40,7 @@ along with this program. If not, see . #define PS_MARKMESSAGESASREAD "/MarkMessagesAsRead" #define MAXHISTORYMIDSPERONE 100 #define MAX_RETRIES 10 +#define MAX_CONTACTS_PER_REQUEST 1000 struct CVkProto : public PROTO diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 4775fe83fb..79ce7295a2 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -392,6 +392,7 @@ void CVkProto::RetrieveUsersInfo(bool bFreeOffline, bool bRepeat) return; CMString userIDs, code; + int i = 0; for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { LONG userID = getDword(hContact, "ID", -1); if (userID == -1 || userID == VK_FEED_USER) @@ -399,6 +400,10 @@ void CVkProto::RetrieveUsersInfo(bool bFreeOffline, bool bRepeat) if (!userIDs.IsEmpty()) userIDs.AppendChar(','); userIDs.AppendFormat(_T("%i"), userID); + + if (i == MAX_CONTACTS_PER_REQUEST) + break; + i++; } CMString codeformat("var userIDs=\"%s\";var _fields=\"%s\";"); -- cgit v1.2.3