summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/dropbox_services.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-02-27 09:59:53 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-02-27 09:59:53 +0000
commit2e51a3103f26ca7a9fec8f96baf56f4d51fd0112 (patch)
tree239feacbe6263d41b7bb021f4e226e2687775904 /plugins/Dropbox/src/dropbox_services.cpp
parent9b5210ac07c6e4e00af25eb90fdf653da791299a (diff)
Dropbox:
- added error notifications - fixed menu items behavior git-svn-id: http://svn.miranda-ng.org/main/trunk@8283 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_services.cpp')
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp29
1 files changed, 7 insertions, 22 deletions
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp
index 1ce493c25a..bae1d1d548 100644
--- a/plugins/Dropbox/src/dropbox_services.cpp
+++ b/plugins/Dropbox/src/dropbox_services.cpp
@@ -21,6 +21,9 @@ INT_PTR CDropbox::ProtoGetCaps(WPARAM wParam, LPARAM lParam)
INT_PTR CDropbox::ProtoSendFile(WPARAM wParam, LPARAM lParam)
{
+ if (!HasAccessToken())
+ return ACKRESULT_FAILED;
+
CCSDATA *pccsd = (CCSDATA*)lParam;
FileTransfer *ftp = new FileTransfer();
@@ -84,7 +87,7 @@ INT_PTR CDropbox::ProtoSendFile(WPARAM wParam, LPARAM lParam)
return fileId;
}
-INT_PTR CDropbox::ProtoSendMessage( WPARAM wParam, LPARAM lParam)
+INT_PTR CDropbox::ProtoSendMessage(WPARAM wParam, LPARAM lParam)
{
CCSDATA *pccsd = (CCSDATA*)lParam;
@@ -95,8 +98,8 @@ INT_PTR CDropbox::ProtoSendMessage( WPARAM wParam, LPARAM lParam)
dbei.timestamp = time(NULL);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = strlen(message);
- dbei.pBlob = (PBYTE)mir_strdup(message);
- //dbei.flags = DBEF_UTF;
+ dbei.pBlob = (PBYTE)message;
+ dbei.flags = DBEF_SENT | DBEF_UTF;
db_event_add(pccsd->hContact, &dbei);
return 0;
@@ -104,7 +107,7 @@ INT_PTR CDropbox::ProtoSendMessage( WPARAM wParam, LPARAM lParam)
INT_PTR CDropbox::RequestApiAuthorization(WPARAM wParam, LPARAM lParam)
{
- mir_forkthread(CDropbox::RequestApiAuthorizationAsync, (void*)wParam);
+ mir_forkthread(CDropbox::RequestApiAuthorizationAsync, 0);
return 0;
}
@@ -120,22 +123,4 @@ INT_PTR CDropbox::SendFilesToDropbox(WPARAM hContact, LPARAM lParam)
dcftp[hwnd] = hContact;
return 0;
-}
-
-int CDropbox::OnFileDoalogCancelled(WPARAM hContact, LPARAM lParam)
-{
- HWND hwnd = (HWND)lParam;
- if (INSTANCE->hContactTransfer == dcftp[hwnd])
- dcftp.erase((HWND)lParam);
-
- return 0;
-}
-
-int CDropbox::OnFileDoalogSuccessed(WPARAM hContact, LPARAM lParam)
-{
- HWND hwnd = (HWND)lParam;
- if (INSTANCE->hContactTransfer == dcftp[hwnd])
- dcftp.erase((HWND)lParam);
-
- return 0;
} \ No newline at end of file