From aeaa92e5fc1f713ff96122e15321ba11dd0609db Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 6 Sep 2015 10:16:05 +0000 Subject: VKontakte: more correct error handling git-svn-id: http://svn.miranda-ng.org/main/trunk@15284 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_files.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'protocols/VKontakte') 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; } -- cgit v1.2.3