summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-09-24 16:30:09 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-09-24 16:30:09 +0000
commit5cfd54b9152944f686c2ca2402e85280b3130f32 (patch)
treef0487a6e40e82743e729fa6e56b375dde334333d /plugins/SendScreenshotPlus/src/CSendDropbox.cpp
parentc35fd2f8545f73f5dacded24bd8124a9b575c98d (diff)
SendSS: correct version of prevoious commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@15434 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SendScreenshotPlus/src/CSendDropbox.cpp')
-rw-r--r--plugins/SendScreenshotPlus/src/CSendDropbox.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
index 635a7f3673..30d01d22f8 100644
--- a/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendDropbox.cpp
@@ -34,14 +34,12 @@ CSendDropbox::CSendDropbox(HWND Owner, MCONTACT hContact, bool bAsync)
: CSend(Owner, hContact, bAsync)
{
/// @todo : re-enable SS_DLG_DELETEAFTERSSEND with full implemention of Dropbox upload with progress, msg and sounds
- m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND/* | SS_DLG_DELETEAFTERSSEND*/;
+ m_EnableItem = SS_DLG_DESCRIPTION | SS_DLG_AUTOSEND | SS_DLG_DELETEAFTERSSEND;
m_pszSendTyp = TranslateT("Dropbox transfer");
- m_hEvent = CreateEvent(NULL, 0, 0, NULL);
}
CSendDropbox::~CSendDropbox()
{
- CloseHandle(m_hEvent);
}
//---------------------------------------------------------------------------
@@ -59,7 +57,6 @@ void CSendDropbox::SendThread()
/// @todo : SS_DLG_DESCRIPTION and SS_DLG_DELETEAFTERSSEND are of no use as of now since we don't track upload progress
m_hDropHook = HookEventObj(ME_DROPBOX_SENT, OnDropSend, this);
- m_hOnAck = HookEventObj(ME_PROTO_ACK, OnDropAck, this);
if ((m_hDropSend = (HANDLE)CallService(MS_DROPBOX_SEND_FILE, (WPARAM)m_hContact, (LPARAM)m_pszFile)) == NULL)
{
@@ -67,8 +64,7 @@ void CSendDropbox::SendThread()
Exit(ACKRESULT_FAILED); return;
}
- WaitForSingleObject(m_hEvent, INFINITE);
- UnhookEvent(m_hOnAck);
+ m_hEvent.Wait();
UnhookEvent(m_hDropHook);
if (m_URL)
@@ -87,24 +83,7 @@ int CSendDropbox::OnDropSend(void *obj, WPARAM, LPARAM lParam)
{
self->m_URL = mir_strdup(info->data[0]);
}
- SetEvent(self->m_hEvent);
- }
- return 0;
-}
-
-int CSendDropbox::OnDropAck(void *obj, WPARAM, LPARAM lParam)
-{
- CSendDropbox* self = (CSendDropbox*)obj;
- ACKDATA *ack = (ACKDATA*)lParam;
- if (ack->hProcess == self->m_hDropSend)
- {
- switch (ack->result)
- {
- case ACKRESULT_DENIED:
- case ACKRESULT_FAILED:
- SetEvent(self->m_hEvent);
- break;
- }
+ self->m_hEvent.Set();
}
return 0;
}