summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-06 10:16:05 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-06 10:16:05 +0000
commitaeaa92e5fc1f713ff96122e15321ba11dd0609db (patch)
tree7edac1a774c5462cd39f4225243e5493ada41e0e /protocols/VKontakte
parent445550db9d2753087d883379771e597c8a1ae881 (diff)
VKontakte: more correct error handling
git-svn-id: http://svn.miranda-ng.org/main/trunk@15284 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/vk_files.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp
index 59c5f92039..aa32117e61 100644
--- a/protocols/VKontakte/src/vk_files.cpp
+++ b/protocols/VKontakte/src/vk_files.cpp
@@ -82,8 +82,8 @@ HANDLE CVkProto::SendFile(MCONTACT hContact, const TCHAR *desc, TCHAR **files)
void CVkProto::SendFileFiled(CVkFileUploadParam *fup, TCHAR *reason)
{
debugLog(_T("CVkProto::SendFileFiled <%s> Error code <%d>"), reason, fup->iErrorCode);
- ProtoBroadcastAck(fup->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, (HANDLE)fup);
CMString tszError;
+ int iResult = ACKRESULT_FAILED;
switch (fup->iErrorCode) {
case VKERR_COULD_NOT_SAVE_FILE:
tszError = TranslateT("Couldn't save file");
@@ -102,6 +102,7 @@ void CVkProto::SendFileFiled(CVkFileUploadParam *fup, TCHAR *reason)
break;
case VKERR_AUDIO_DEL_COPYRIGHT:
tszError = TranslateT("The audio file was removed by the copyright holder and cannot be reuploaded");
+ iResult = ACKRESULT_DENIED;
break;
case VKERR_INVALID_FILENAME:
tszError = TranslateT("Invalid filename");
@@ -112,6 +113,7 @@ void CVkProto::SendFileFiled(CVkFileUploadParam *fup, TCHAR *reason)
default:
tszError = TranslateT("Unknown error occurred");
}
+ ProtoBroadcastAck(fup->hContact, ACKTYPE_FILE, iResult, (HANDLE)fup);
MsgPopup(NULL, tszError, TranslateT("File upload error"), true);
delete fup;
}