summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2019-04-21 23:13:19 +0500
committerElzorFox <elzorfox@ya.ru>2019-04-21 23:13:19 +0500
commit15c5c464cb94151a5ac6b4f0b1925eb0a390cca0 (patch)
tree27d6cbc363ffc7df3c277d439ec6f5984c66b331 /protocols/VKontakte
parentff7881bce42ca878d46258b24f241f50619efe59 (diff)
VKontakte:
send .ogg as audio messages version bump
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/version.h2
-rw-r--r--protocols/VKontakte/src/vk_files.cpp6
-rw-r--r--protocols/VKontakte/src/vk_struct.cpp5
-rw-r--r--protocols/VKontakte/src/vk_struct.h2
4 files changed, 13 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h
index f3b9b3737d..aa0365ba93 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 9
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp
index 2160a722a9..adcec0f2b5 100644
--- a/protocols/VKontakte/src/vk_files.cpp
+++ b/protocols/VKontakte/src/vk_files.cpp
@@ -42,6 +42,10 @@ HANDLE CVkProto::SendFile(MCONTACT hContact, const wchar_t *desc, wchar_t **file
case CVkFileUploadParam::typeAudio:
pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/audio.getUploadServer.json", true, &CVkProto::OnReciveUploadServer);
break;
+ case CVkFileUploadParam::typeAudioMsg:
+ pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/docs.getUploadServer.json", true, &CVkProto::OnReciveUploadServer);
+ pReq << CHAR_PARAM("type", "audio_message");
+ break;
case CVkFileUploadParam::typeDoc:
pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/docs.getUploadServer.json", true, &CVkProto::OnReciveUploadServer);
break;
@@ -276,6 +280,7 @@ void CVkProto::OnReciveUpload(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
pUploadReq << WCHAR_PARAM("server", server) << WCHAR_PARAM("audio", upload) << WCHAR_PARAM("hash", hash);
break;
case CVkFileUploadParam::typeDoc:
+ case CVkFileUploadParam::typeAudioMsg:
upload = jnRoot["file"].as_mstring();
if (upload.IsEmpty()) {
SendFileFiled(fup, VKERR_INVALID_PARAMETERS);
@@ -331,6 +336,7 @@ void CVkProto::OnReciveUploadFile(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR
Attachment.AppendFormat(L"audio%d_%d", owner_id, id);
break;
case CVkFileUploadParam::typeDoc:
+ case CVkFileUploadParam::typeAudioMsg:
Attachment.AppendFormat(L"doc%d_%d", owner_id, id);
break;
default:
diff --git a/protocols/VKontakte/src/vk_struct.cpp b/protocols/VKontakte/src/vk_struct.cpp
index 4793891447..0a687ab270 100644
--- a/protocols/VKontakte/src/vk_struct.cpp
+++ b/protocols/VKontakte/src/vk_struct.cpp
@@ -105,6 +105,7 @@ CVkFileUploadParam::VKFileType CVkFileUploadParam::GetType()
wchar_t img[] = L".jpg .jpeg .png .bmp";
wchar_t audio[] = L".mp3";
+ wchar_t audiomsg[] = L".ogg";
wchar_t DRIVE[3], DIR[256], FNAME[256], EXT[256];
_wsplitpath(FileName, DRIVE, DIR, FNAME, EXT);
@@ -121,6 +122,10 @@ CVkFileUploadParam::VKFileType CVkFileUploadParam::GetType()
filetype = CVkFileUploadParam::typeAudio;
atr = mir_strdup("file");
}
+ else if (wlstrstr(audiomsg, EXT)) {
+ filetype = CVkFileUploadParam::typeAudioMsg;
+ atr = mir_strdup("file");
+ }
else {
filetype = CVkFileUploadParam::typeDoc;
atr = mir_strdup("file");
diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h
index 89077432dd..16e20217df 100644
--- a/protocols/VKontakte/src/vk_struct.h
+++ b/protocols/VKontakte/src/vk_struct.h
@@ -37,7 +37,7 @@ struct AsyncHttpRequest : public MTHttpRequest<CVkProto>
};
struct CVkFileUploadParam : public MZeroedObject {
- enum VKFileType { typeInvalid, typeImg, typeAudio, typeDoc, typeNotSupported };
+ enum VKFileType { typeInvalid, typeImg, typeAudio, typeAudioMsg, typeDoc, typeNotSupported };
wchar_t *FileName;
wchar_t *Desc;
char *atr;