From c3ac85191fbe50a4afb5a670cb57ff4a189507d0 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 19 Mar 2014 08:01:21 +0000 Subject: Dropbox: hides menu item and tabsrmm button when hasn't access to dropbox account git-svn-id: http://svn.miranda-ng.org/main/trunk@8658 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/dropbox_events.cpp | 2 +- plugins/Dropbox/src/dropbox_menus.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Dropbox/src/dropbox_events.cpp b/plugins/Dropbox/src/dropbox_events.cpp index d568d42fd8..df5dfc14a4 100644 --- a/plugins/Dropbox/src/dropbox_events.cpp +++ b/plugins/Dropbox/src/dropbox_events.cpp @@ -99,7 +99,7 @@ int CDropbox::OnSrmmWindowOpened(void *obj, WPARAM wParam, LPARAM lParam) bbd.pszModuleName = MODULE; bbd.dwButtonID = BBB_ID_FILE_SEND; bbd.bbbFlags = BBSF_RELEASED; - if (ev->hContact == instance->GetDefaultContact() || !instance->HasAccessToken()) + if (!instance->HasAccessToken() || ev->hContact == instance->GetDefaultContact() || !instance->HasAccessToken()) bbd.bbbFlags = BBSF_HIDDEN | BBSF_DISABLED; else if (status == ID_STATUS_OFFLINE && !canSendOffline) bbd.bbbFlags = BBSF_DISABLED; diff --git a/plugins/Dropbox/src/dropbox_menus.cpp b/plugins/Dropbox/src/dropbox_menus.cpp index b7e60b6198..fe5f38d234 100644 --- a/plugins/Dropbox/src/dropbox_menus.cpp +++ b/plugins/Dropbox/src/dropbox_menus.cpp @@ -23,6 +23,9 @@ int CDropbox::OnPrebuildContactMenu(void *obj, WPARAM hContact, LPARAM lParam) Menu_ShowItem(instance->contactMenuItems[CMI_SEND_FILES], FALSE); + if (!instance->HasAccessToken()) + return 0; + char *proto = GetContactProto(hContact); WORD status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE); bool canSendOffline = (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDOFFLINE) > 0; -- cgit v1.2.3