diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-04-04 19:43:40 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-04-04 19:43:40 +0000 |
commit | 7e7e977e3dd74fe09c62d7b345bbbbecf33602a4 (patch) | |
tree | 88dc22b8f60b4a9b132bb4836eef1a140570ad04 /plugins/Dropbox/src/dropbox_events.cpp | |
parent | c8a6fc65ff5e3f53a9b7695f1d9674b7d7886566 (diff) |
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
Diffstat (limited to 'plugins/Dropbox/src/dropbox_events.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_events.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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);
|