diff options
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.h | 1 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 5 |
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\";");
|