diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-02-24 18:08:46 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-02-24 18:08:46 +0000 |
commit | 03563512f9572fe74bc60adba3f7b6cdcc1d1047 (patch) | |
tree | fc2989c4c6a495ab461a5234184711624362e714 /plugins/Dropbox/src/dropbox_events.cpp | |
parent | e62bc2a6f28f6a7b7fcb3996e9fab86fae3239f7 (diff) |
Dropbox: fixed status detection
git-svn-id: http://svn.miranda-ng.org/main/trunk@8264 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_events.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_events.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/Dropbox/src/dropbox_events.cpp b/plugins/Dropbox/src/dropbox_events.cpp index b670370ae2..8f234b770d 100644 --- a/plugins/Dropbox/src/dropbox_events.cpp +++ b/plugins/Dropbox/src/dropbox_events.cpp @@ -69,16 +69,19 @@ int CDropbox::OnContactDeleted(WPARAM hContact, LPARAM lParam) return 0;
}
-int CDropbox::OnSrmmWindowOpened(WPARAM hContact, LPARAM lParam)
+int CDropbox::OnSrmmWindowOpened(WPARAM wParam, LPARAM lParam)
{
MessageWindowEventData *ev = (MessageWindowEventData*)lParam;
if (ev->uType == MSG_WINDOW_EVT_OPENING && ev->hContact)
{
- WORD status = CallContactService(hContact, PS_GETSTATUS, 0, 0);
+ WORD status = db_get_w(ev->hContact, GetContactProto(ev->hContact), "Status", ID_STATUS_OFFLINE);
BBButton bbd = { sizeof(bbd) };
bbd.pszModuleName = MODULE;
- bbd.bbbFlags = (ev->hContact != INSTANCE->GetDefaultContact() || status == ID_STATUS_OFFLINE) ? 0 : BBSF_HIDDEN | BBSF_DISABLED;
+ if (ev->hContact == INSTANCE->GetDefaultContact())
+ bbd.bbbFlags = BBSF_HIDDEN | BBSF_DISABLED;
+ else if (status == ID_STATUS_OFFLINE)
+ bbd.bbbFlags = BBSF_DISABLED;
bbd.dwButtonID = BBB_ID_FILE_SEND;
CallService(MS_BB_SETBUTTONSTATE, (WPARAM)ev->hContact, (LPARAM)&bbd);
@@ -87,16 +90,16 @@ int CDropbox::OnSrmmWindowOpened(WPARAM hContact, LPARAM lParam) return 0;
}
-int CDropbox::OnSrmmButtonPressed(WPARAM hContact, LPARAM lParam)
+int CDropbox::OnSrmmButtonPressed(WPARAM wParam, LPARAM lParam)
{
CustomButtonClickData *cbc = (CustomButtonClickData *)lParam;
- if (!strcmp(cbc->pszModule, MODULE) && cbc->dwButtonId == BBB_ID_FILE_SEND && hContact)
+ if (!strcmp(cbc->pszModule, MODULE) && cbc->dwButtonId == BBB_ID_FILE_SEND && cbc->hContact)
{
- INSTANCE->hContactTransfer = hContact;
+ INSTANCE->hContactTransfer = cbc->hContact;
HWND hwnd = (HWND)CallService(MS_FILE_SENDFILE, INSTANCE->GetDefaultContact(), 0);
- dcftp[hwnd] = hContact;
+ dcftp[hwnd] = cbc->hContact;
}
return 0;
|