summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/dropbox_menus.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-05-13 18:17:16 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-05-13 18:17:16 +0000
commitd333cb91eb0fb51faf34772258a5084e95f047d8 (patch)
treeacc62fd676325289711ab054682cb84ea0c7f29e /plugins/Dropbox/src/dropbox_menus.cpp
parentac60e6cd374568da60bf732a8018f94d48ee9dd7 (diff)
Dropbox: added wrappers for instance's services and hooks
git-svn-id: http://svn.miranda-ng.org/main/trunk@13573 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_menus.cpp')
-rw-r--r--plugins/Dropbox/src/dropbox_menus.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/Dropbox/src/dropbox_menus.cpp b/plugins/Dropbox/src/dropbox_menus.cpp
index 79bf9d31eb..e14948e791 100644
--- a/plugins/Dropbox/src/dropbox_menus.cpp
+++ b/plugins/Dropbox/src/dropbox_menus.cpp
@@ -25,17 +25,19 @@ void CDropbox::InitializeMenus()
CreateServiceFunctionObj(mi.pszService, SendFilesToDropboxCommand, this);
}
-int CDropbox::OnPrebuildContactMenu(void *obj, WPARAM hContact, LPARAM)
+int CDropbox::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
{
if (!hContact)
return 0;
BOOL bShow = FALSE;
- CDropbox *instance = (CDropbox*)obj;
- if (instance->HasAccessToken() && !instance->hTransferContact && hContact != instance->GetDefaultContact()) {
+ if (HasAccessToken() && !hTransferContact && hContact != GetDefaultContact())
+ {
char *proto = GetContactProto(hContact);
- if (proto && !db_get_b(hContact, proto, "ChatRoom", 0)) {
+ bool isContact = db_get_b(hContact, proto, "ChatRoom", 0) == 0;
+ if (proto && isContact)
+ {
bool isProtoOnline = CallProtoService(proto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE;
WORD status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
bool canSendOffline = (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDOFFLINE) > 0;
@@ -44,6 +46,6 @@ int CDropbox::OnPrebuildContactMenu(void *obj, WPARAM hContact, LPARAM)
}
}
- Menu_ShowItem(instance->contactMenuItems[CMI_SEND_FILES], bShow);
+ Menu_ShowItem(contactMenuItems[CMI_SEND_FILES], bShow);
return 0;
}