From f8830ba4d8827a9460de51e17ccd8caeed7217e2 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 13 May 2015 20:12:06 +0000 Subject: Dropbox: some fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@13577 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/dropbox_services.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'plugins/Dropbox/src/dropbox_services.cpp') diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index 37b807eedc..c32ebf1802 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -46,11 +46,14 @@ INT_PTR CDropbox::ProtoGetStatus(WPARAM, LPARAM) INT_PTR CDropbox::ProtoSendFile(WPARAM, LPARAM lParam) { - if (!HasAccessToken()) - return ACKRESULT_FAILED; - CCSDATA *pccsd = (CCSDATA*)lParam; + if (!HasAccessToken()) + { + ProtoBroadcastAck(MODULE, pccsd->hContact, ACKTYPE_FILE, ACKRESULT_FAILED, NULL, (LPARAM)"You cannot send files when you are not authorized."); + return 0; + } + FileTransferParam *ftp = new FileTransferParam(); ftp->pfts.flags |= PFTS_SENDING; ftp->pfts.hContact = pccsd->hContact; @@ -124,9 +127,6 @@ INT_PTR CDropbox::ProtoSendFile(WPARAM, LPARAM lParam) INT_PTR CDropbox::ProtoCancelFile(WPARAM, LPARAM lParam) { - if (!HasAccessToken()) - return ACKRESULT_FAILED; - CCSDATA *pccsd = (CCSDATA*)lParam; HANDLE hTransfer = (HANDLE)pccsd->wParam; @@ -141,11 +141,14 @@ INT_PTR CDropbox::ProtoCancelFile(WPARAM, LPARAM lParam) INT_PTR CDropbox::ProtoSendMessage(WPARAM, LPARAM lParam) { - if (!HasAccessToken()) - return ACKRESULT_FAILED; - CCSDATA *pccsd = (CCSDATA*)lParam; + if (!HasAccessToken()) + { + ProtoBroadcastAck(MODULE, pccsd->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)"You cannot send messages when you are not authorized."); + return 0; + } + char *message = NULL; char *szMessage = (char*)pccsd->lParam; if (pccsd->wParam & PREF_UNICODE) -- cgit v1.2.3