From 7e7e977e3dd74fe09c62d7b345bbbbecf33602a4 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 4 Apr 2014 19:43:40 +0000 Subject: Dropbox: hides "Send to Dropbox" item when protocol is offline git-svn-id: http://svn.miranda-ng.org/main/trunk@8857 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/dropbox_events.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/Dropbox/src/dropbox_events.cpp') diff --git a/plugins/Dropbox/src/dropbox_events.cpp b/plugins/Dropbox/src/dropbox_events.cpp index df5dfc14a4..efd8687762 100644 --- a/plugins/Dropbox/src/dropbox_events.cpp +++ b/plugins/Dropbox/src/dropbox_events.cpp @@ -92,6 +92,7 @@ int CDropbox::OnSrmmWindowOpened(void *obj, WPARAM wParam, LPARAM lParam) if (ev->uType == MSG_WINDOW_EVT_OPENING && ev->hContact) { char *proto = GetContactProto(ev->hContact); + bool isProtoOnline = CallProtoService(proto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE; WORD status = db_get_w(ev->hContact, proto, "Status", ID_STATUS_OFFLINE); bool canSendOffline = (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDOFFLINE) > 0; @@ -101,7 +102,7 @@ int CDropbox::OnSrmmWindowOpened(void *obj, WPARAM wParam, LPARAM lParam) bbd.bbbFlags = BBSF_RELEASED; if (!instance->HasAccessToken() || ev->hContact == instance->GetDefaultContact() || !instance->HasAccessToken()) bbd.bbbFlags = BBSF_HIDDEN | BBSF_DISABLED; - else if (status == ID_STATUS_OFFLINE && !canSendOffline) + else if (!isProtoOnline || (status == ID_STATUS_OFFLINE && !canSendOffline)) bbd.bbbFlags = BBSF_DISABLED; CallService(MS_BB_SETBUTTONSTATE, ev->hContact, (LPARAM)&bbd); -- cgit v1.2.3