From 7478b207dea289dcddb5e1bce5b5191ac92605b1 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 20 Apr 2014 18:52:22 +0000 Subject: Dropbox: service and events reworked git-svn-id: http://svn.miranda-ng.org/main/trunk@9005 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/dropbox_services.cpp | 33 ++++---------------------------- 1 file changed, 4 insertions(+), 29 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 db2e2c8be2..9197a82eed 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -33,7 +33,6 @@ INT_PTR CDropbox::ProtoSendFile(void *obj, WPARAM, LPARAM lParam) CCSDATA *pccsd = (CCSDATA*)lParam; FileTransferParam *ftp = new FileTransferParam(); - ftp->withVisualisation = true; ftp->pfts.flags |= PFTS_SENDING; ftp->pfts.hContact = pccsd->hContact; ftp->hContact = (instance->hTransferContact) ? instance->hTransferContact : pccsd->hContact; @@ -99,7 +98,7 @@ INT_PTR CDropbox::ProtoSendFile(void *obj, WPARAM, LPARAM lParam) ULONG fileId = InterlockedIncrement(&instance->hFileProcess); ftp->hProcess = (HANDLE)fileId; - mir_forkthreadowner(CDropbox::SendFilesAsync, obj, ftp, 0); + mir_forkthreadowner(CDropbox::SendFilesAndReportAsync, obj, ftp, 0); return fileId; } @@ -199,13 +198,12 @@ INT_PTR CDropbox::SendFileToDropbox(void *obj, WPARAM hContact, LPARAM lParam) if (!instance->HasAccessToken()) return 0; - wchar_t *filePath = (wchar_t*)lParam; - if (hContact == NULL) hContact = instance->GetDefaultContact(); + wchar_t *filePath = (wchar_t*)lParam; + FileTransferParam *ftp = new FileTransferParam(); - ftp->withVisualisation = false; ftp->pfts.flags |= PFTS_SENDING; ftp->pfts.hContact = hContact; ftp->pfts.totalFiles = 1; @@ -224,30 +222,7 @@ INT_PTR CDropbox::SendFileToDropbox(void *obj, WPARAM hContact, LPARAM lParam) ULONG fileId = InterlockedIncrement(&instance->hFileProcess); ftp->hProcess = (HANDLE)fileId; - mir_forkthreadowner(CDropbox::SendFilesAsync, obj, ftp, 0); + mir_forkthreadowner(CDropbox::SendFilesAndEventAsync, obj, ftp, 0); return fileId; -} - -INT_PTR CDropbox::SendFilesToDropbox(void *obj, WPARAM hContact, LPARAM) -{ - CDropbox *instance = (CDropbox*)obj; - - if (!instance->HasAccessToken()) - return 1; - - instance->hTransferContact = hContact; - - HWND hwnd = (HWND)CallService(MS_FILE_SENDFILE, instance->GetDefaultContact(), 0); - - instance->dcftp[hwnd] = hContact; - - BBButton bbd = { sizeof(bbd) }; - bbd.pszModuleName = MODULE; - bbd.dwButtonID = BBB_ID_FILE_SEND; - bbd.bbbFlags = BBSF_DISABLED; - - CallService(MS_BB_SETBUTTONSTATE, hContact, (LPARAM)&bbd); - - return 0; } \ No newline at end of file -- cgit v1.2.3