summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/theme.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2016-07-16 13:38:08 +0000
committerRobert Pösel <robyer@seznam.cz>2016-07-16 13:38:08 +0000
commit3a30fdfc6c545ba51cf1587b58b22316f2622e8f (patch)
tree06daf3b099663cba01f6e2432ca8f2b8f020bbee /protocols/FacebookRM/src/theme.cpp
parent5dc9ff65b453efdcbe2218720307fae52b5d6e90 (diff)
Facebook: Improve working with different user types (friend, user, page)
Also simplify arguments of AddToContactList method. And don't show auth items in contact menu for page contacts. git-svn-id: http://svn.miranda-ng.org/main/trunk@17099 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/theme.cpp')
-rw-r--r--protocols/FacebookRM/src/theme.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index d0304b0a47..b6f6481a14 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -199,17 +199,19 @@ void InitContactMenus()
int FacebookProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
{
MCONTACT hContact = MCONTACT(wParam);
+
+ BYTE type = getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0);
bool bIsChatroom = isChatRoom(hContact);
+ bool bIsPage = (type == CONTACT_PAGE);
Menu_ShowItem(g_hContactMenuVisitProfile, !bIsChatroom);
- Menu_ShowItem(g_hContactMenuVisitFriendship, !bIsChatroom);
+ Menu_ShowItem(g_hContactMenuVisitFriendship, !bIsChatroom && !bIsPage);
Menu_ShowItem(g_hContactMenuVisitConversation, true);
Menu_ShowItem(g_hContactMenuPostStatus, !bIsChatroom);
- if (!isOffline() && !bIsChatroom)
+ if (!isOffline() && !bIsChatroom && !bIsPage)
{
bool ctrlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
- BYTE type = getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0);
Menu_ShowItem(g_hContactMenuAuthAsk, ctrlPressed || type == CONTACT_NONE || !type);
Menu_ShowItem(g_hContactMenuAuthGrant, ctrlPressed || type == CONTACT_APPROVE);