diff options
-rw-r--r-- | plugins/Dropbox/src/dropbox_events.cpp | 17 | ||||
-rw-r--r-- | plugins/Dropbox/src/dropbox_menus.cpp | 13 |
2 files changed, 17 insertions, 13 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;
diff --git a/plugins/Dropbox/src/dropbox_menus.cpp b/plugins/Dropbox/src/dropbox_menus.cpp index f510858240..a4047d4be8 100644 --- a/plugins/Dropbox/src/dropbox_menus.cpp +++ b/plugins/Dropbox/src/dropbox_menus.cpp @@ -40,17 +40,18 @@ int CDropbox::OnPrebuildContactMenu(WPARAM hContact, LPARAM lParam) return 0;
//bool ctrlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
- WORD status = CallContactService(hContact, PS_GETSTATUS, 0, 0);
+ char *module = GetContactProto(hContact);
+ WORD status = db_get_w(hContact, module, "Status", ID_STATUS_OFFLINE);
+ CallContactService(hContact, PS_GETSTATUS, 0, 0);
if (hContact == INSTANCE->GetDefaultContact() || status == ID_STATUS_OFFLINE)
Menu_ShowItem(INSTANCE->ContactMenuItems[CMI_SEND_FILES], FALSE);
else
- {
Menu_DisableItem(INSTANCE->ContactMenuItems[CMI_SEND_FILES], INSTANCE->hContactTransfer);
- if (strcmp(GetContactProto(hContact), MODULE))
- {
- Menu_ShowItem(INSTANCE->ContactMenuItems[CMI_API_REQUEST_AUTH], FALSE);
- }
+
+ if (strcmp(module, MODULE))
+ {
+ Menu_ShowItem(INSTANCE->ContactMenuItems[CMI_API_REQUEST_AUTH], FALSE);
}
return 0;
|