diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-03-21 16:20:52 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-03-21 16:20:52 +0000 |
commit | 1b05ca00694530f1ec25fae6f7bf850895748b30 (patch) | |
tree | c4f5ceeb39334423a108ae60f189fa5fbd308736 /protocols/VKontakte/src/vk_proto.cpp | |
parent | 7f657fce5090d089d0600d815a6db93050562f12 (diff) |
VKontakte:
m_arRequestsQueue as queue with priority
set high priority for sending and receiving messages
version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@12471 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 16a3fc1c64..a3dc5f01c8 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -22,12 +22,19 @@ static int sttCompareProtocols(const CVkProto *p1, const CVkProto *p2) return mir_tstrcmp(p1->m_tszUserName, p2->m_tszUserName);
}
+static int sttCompareAsyncHttpRequest(const AsyncHttpRequest *p1, const AsyncHttpRequest *p2)
+{
+ if (p1->m_priority == p2->m_priority)
+ return (int)p1->m_time - (int)p2->m_time;
+ return (int)p2->m_priority - (int)p1->m_priority;
+}
+
LIST<CVkProto> vk_Instances(1, sttCompareProtocols);
static COLORREF sttColors[] = { 0, 1, 2, 3, 4, 5, 6 };
CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
PROTO<CVkProto>(szModuleName, ptszUserName),
- m_arRequestsQueue(10),
+ m_arRequestsQueue(10, sttCompareAsyncHttpRequest),
m_sendIds(3, PtrKeySortT),
m_incIds(3, PtrKeySortT),
m_cookies(5),
@@ -595,7 +602,7 @@ int CVkProto::UserIsTyping(MCONTACT hContact, int type) if (m_iMarkMessageReadOn == markOnTyping)
MarkMessagesRead(hContact);
- Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.setActivity.json", true, &CVkProto::OnReceiveSmth)
+ Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.setActivity.json", true, &CVkProto::OnReceiveSmth, AsyncHttpRequest::rpLow)
<< INT_PARAM("user_id", userID)
<< CHAR_PARAM("type", "typing")
<< VER_API);
|