From 685d7ca062ead553f5db6c9e1774b76ef123efbb Mon Sep 17 00:00:00 2001 From: ElzorFox Date: Mon, 4 Oct 2021 13:59:03 +0500 Subject: VKontakte: fix audio messages sending version bump --- protocols/VKontakte/src/version.h | 2 +- protocols/VKontakte/src/vk_files.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h index 3814afc121..fe17411078 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 12 -#define __BUILD_NUM 1 +#define __BUILD_NUM 2 #include diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp index 581ef8bf5f..6b2dfda9e2 100644 --- a/protocols/VKontakte/src/vk_files.cpp +++ b/protocols/VKontakte/src/vk_files.cpp @@ -288,7 +288,11 @@ void CVkProto::OnReciveUpload(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) return; } pUploadReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/docs.save.json", true, &CVkProto::OnReciveUploadFile); - pUploadReq << CHAR_PARAM("title", fup->fileName()) << WCHAR_PARAM("file", upload); + pUploadReq + << CHAR_PARAM("title", fup->fileName()) + << WCHAR_PARAM("file", upload) + << CHAR_PARAM("tags", fup->fileName()) + << INT_PARAM("return_tags", 0); break; default: SendFileFiled(fup, VKERR_FTYPE_NOT_SUPPORTED); @@ -322,13 +326,13 @@ void CVkProto::OnReciveUploadFile(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR } int id, owner_id; - if (fup->GetType() == CVkFileUploadParam::typeDoc) { + if ((fup->GetType() == CVkFileUploadParam::typeDoc) || (fup->GetType() == CVkFileUploadParam::typeAudioMsg)) { CMStringA wszType(jnResponse["type"].as_mstring()); const JSONNode& jnDoc = jnResponse[wszType]; id = jnDoc["id"].as_int(); owner_id = jnDoc["owner_id"].as_int(); } - else { + else{ id = fup->GetType() == CVkFileUploadParam::typeAudio ? jnResponse["id"].as_int() : (*jnResponse.begin())["id"].as_int(); owner_id = fup->GetType() == CVkFileUploadParam::typeAudio ? jnResponse["owner_id"].as_int() : (*jnResponse.begin())["owner_id"].as_int(); } -- cgit v1.2.3