summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2016-02-08 03:33:39 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2016-02-08 03:33:39 +0000
commit0e015080019d3a9d6f75efde41a7c654491f5db2 (patch)
tree104abb4d74438b1401ab926ec914ff8c236a0720 /protocols/VKontakte/src
parentba6ef9fbed9e7ea74794044dbfed040eae74cc33 (diff)
VKontakte: fix(?) vk error 13 on RetrieveUsersInfo
git-svn-id: http://svn.miranda-ng.org/main/trunk@16245 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r--protocols/VKontakte/src/vk_proto.h1
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp5
2 files changed, 6 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
#define PS_MARKMESSAGESASREAD "/MarkMessagesAsRead"
#define MAXHISTORYMIDSPERONE 100
#define MAX_RETRIES 10
+#define MAX_CONTACTS_PER_REQUEST 1000
struct CVkProto : public PROTO<CVkProto>
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\";");