summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2024-08-12 21:14:44 +0500
committerElzorFox <elzorfox@ya.ru>2024-08-12 21:14:44 +0500
commitb00ea0fb423e9c778d2580c535bf042f32894918 (patch)
tree93f4441cfba20d3980f8602caf9c254f4af32142 /protocols/VKontakte
parent8b5f4211bb14f12c2943caabc5046e694bd8b056 (diff)
VKontakte:
fix parse message id for outgoing messages version bump
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/res/main.icobin0 -> 5430 bytes
-rw-r--r--protocols/VKontakte/src/version.h2
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp30
3 files changed, 17 insertions, 15 deletions
diff --git a/protocols/VKontakte/res/main.ico b/protocols/VKontakte/res/main.ico
new file mode 100644
index 0000000000..dd9dd15a46
--- /dev/null
+++ b/protocols/VKontakte/res/main.ico
Binary files differ
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index 330ff69a06..6da093fa56 100644
--- a/protocols/VKontakte/src/version.h
+++ b/protocols/VKontakte/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 16
-#define __BUILD_NUM 11
+#define __BUILD_NUM 12
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp
index 5ce9ad0b1e..b0858978d8 100644
--- a/protocols/VKontakte/src/vk_messages.cpp
+++ b/protocols/VKontakte/src/vk_messages.cpp
@@ -214,21 +214,23 @@ void CVkProto::OnSendMessage(MHttpResponse *reply, AsyncHttpRequest *pReq)
JSONNode jnRoot;
const JSONNode &jnResponse = CheckJsonResponse(pReq, reply, jnRoot);
if (jnResponse) {
- debugLogA("CVkProto::OnSendMessage jnResponse %d", jnResponse.as_int());
- switch (jnResponse.type()) {
- case JSON_NUMBER:
- iMessageId = jnResponse.as_int();
- break;
- case JSON_STRING:
- if (swscanf(jnResponse.as_mstring(), L"%u", &iMessageId) != 1)
+ iMessageId = jnResponse["message_id"].as_int();
+ debugLogA("CVkProto::OnSendMessage jnResponse %d", iMessageId ? iMessageId : jnResponse.as_int());
+ if (!iMessageId)
+ switch (jnResponse.type()) {
+ case JSON_NUMBER:
+ iMessageId = jnResponse.as_int();
+ break;
+ case JSON_STRING:
+ if (swscanf(jnResponse.as_mstring(), L"%u", &iMessageId) != 1)
+ iMessageId = 0;
+ break;
+ case JSON_ARRAY:
+ iMessageId = jnResponse.as_array()[json_index_t(0)].as_int();
+ break;
+ default:
iMessageId = 0;
- break;
- case JSON_ARRAY:
- iMessageId = jnResponse.as_array()[json_index_t(0)].as_int();
- break;
- default:
- iMessageId = 0;
- }
+ }
if (iMessageId > ReadQSWord(param->hContact, "lastmsgid"))
WriteQSWord(param->hContact, "lastmsgid", iMessageId);