summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/dropbox_events.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_events.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_events.cpp')
-rw-r--r--plugins/Dropbox/src/dropbox_events.cpp39
1 files changed, 33 insertions, 6 deletions
diff --git a/plugins/Dropbox/src/dropbox_events.cpp b/plugins/Dropbox/src/dropbox_events.cpp
index 8f234b770d..fd2d67d26a 100644
--- a/plugins/Dropbox/src/dropbox_events.cpp
+++ b/plugins/Dropbox/src/dropbox_events.cpp
@@ -20,6 +20,12 @@ int CDropbox::OnModulesLoaded(WPARAM wParam, LPARAM lParam)
if (!CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)MODULE))
{
db_set_s(hContact, MODULE, "Nick", MODULE);
+ db_set_ws(hContact, "CList", "MyHandle", L"Dropbox");
+
+ if (HasAccessToken() && db_get_w(hContact, MODULE, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
+ {
+ db_set_w(hContact, MODULE, "Status", ID_STATUS_ONLINE);
+ }
}
}
@@ -62,8 +68,8 @@ int CDropbox::OnContactDeleted(WPARAM hContact, LPARAM lParam)
{
if (lstrcmpiA(GetContactProto(hContact), MODULE) == 0)
{
- if (INSTANCE->HasAccessToken())
- INSTANCE->DestroyAcceessToken(hContact);
+ if (HasAccessToken())
+ INSTANCE->DestroyAcceessToken();
}
return 0;
@@ -78,13 +84,13 @@ int CDropbox::OnSrmmWindowOpened(WPARAM wParam, LPARAM lParam)
BBButton bbd = { sizeof(bbd) };
bbd.pszModuleName = MODULE;
- if (ev->hContact == INSTANCE->GetDefaultContact())
+ if (ev->hContact == GetDefaultContact() || !HasAccessToken() || status == ID_STATUS_OFFLINE)
bbd.bbbFlags = BBSF_HIDDEN | BBSF_DISABLED;
- else if (status == ID_STATUS_OFFLINE)
+ else if (INSTANCE->hContactTransfer)
bbd.bbbFlags = BBSF_DISABLED;
bbd.dwButtonID = BBB_ID_FILE_SEND;
- CallService(MS_BB_SETBUTTONSTATE, (WPARAM)ev->hContact, (LPARAM)&bbd);
+ CallService(MS_BB_SETBUTTONSTATE, ev->hContact, (LPARAM)&bbd);
}
return 0;
@@ -97,10 +103,31 @@ int CDropbox::OnSrmmButtonPressed(WPARAM wParam, LPARAM lParam)
{
INSTANCE->hContactTransfer = cbc->hContact;
- HWND hwnd = (HWND)CallService(MS_FILE_SENDFILE, INSTANCE->GetDefaultContact(), 0);
+ HWND hwnd = (HWND)CallService(MS_FILE_SENDFILE, GetDefaultContact(), 0);
dcftp[hwnd] = cbc->hContact;
}
return 0;
+}
+
+int CDropbox::OnFileDoalogCancelled(WPARAM hContact, LPARAM lParam)
+{
+ HWND hwnd = (HWND)lParam;
+ if (INSTANCE->hContactTransfer == dcftp[hwnd])
+ {
+ dcftp.erase((HWND)lParam);
+ INSTANCE->hContactTransfer = 0;
+ }
+
+ 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