diff options
author | Robert Pösel <robyer@seznam.cz> | 2012-05-24 15:40:11 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2012-05-24 15:40:11 +0000 |
commit | 73d90fba8c5a90e1195481efa7e59535cf156413 (patch) | |
tree | 5a840a24e5f5da25fbc30921d01fae2c31b6adb3 /protocols/FacebookRM/theme.cpp | |
parent | f78628ed14bc7aa0fd3a7e10c5cb25c71e7748db (diff) |
Update for Facebook RM (processing friend requests, searching support,...)
git-svn-id: http://svn.miranda-ng.org/main/trunk@164 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/theme.cpp')
-rw-r--r-- | protocols/FacebookRM/theme.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/protocols/FacebookRM/theme.cpp b/protocols/FacebookRM/theme.cpp index 7bc62a2317..ddf612e4d6 100644 --- a/protocols/FacebookRM/theme.cpp +++ b/protocols/FacebookRM/theme.cpp @@ -37,7 +37,8 @@ static const icons[] = { "mind", LPGEN("Mind"), IDI_MIND },
{ "removeFriend", LPGEN("Remove from server"), IDI_REMOVEFRIEND },
{ "addFriend", LPGEN("Request friendship"), IDI_ADDFRIEND },
-
+ { "approveFriend", LPGEN("Approve friendship"), 0, "core_main_8" }, // TODO: add better icon
+
{ "homepage", LPGEN("Visit Profile"), 0, "core_main_2" },
};
@@ -106,7 +107,7 @@ char *GetIconDescription(const char* name) }
// Contact List menu stuff
-HANDLE g_hMenuItems[4];
+HANDLE g_hMenuItems[5];
// Helper functions
static FacebookProto * GetInstanceByHContact(HANDLE hContact)
@@ -138,7 +139,7 @@ static int PrebuildContactMenu(WPARAM wParam,LPARAM lParam) return proto ? proto->OnPrebuildContactMenu(wParam,lParam) : 0;
}
-HANDLE hHookPreBuildMenu,sVisitProfile,sAddFriend,sRemoveFriend;
+HANDLE hHookPreBuildMenu, sVisitProfile, sAddFriend, sRemoveFriend, sApproveFriend;
void InitContactMenus()
{
hHookPreBuildMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU,PrebuildContactMenu);
@@ -169,6 +170,14 @@ void InitContactMenus() sAddFriend = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::AddFriend>);
g_hMenuItems[3] = reinterpret_cast<HANDLE>(
CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
+
+ mi.position=-2000006000;
+ mi.icolibItem = GetIconHandle("approveFriend");
+ mi.pszName = GetIconDescription("approveFriend");
+ mi.pszService = "FacebookProto/ApproveFriend";
+ sApproveFriend = CreateServiceFunction(mi.pszService,GlobalService<&FacebookProto::ApproveFriend>);
+ g_hMenuItems[4] = reinterpret_cast<HANDLE>(
+ CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi) );
}
void UninitContactMenus()
@@ -179,6 +188,7 @@ void UninitContactMenus() DestroyServiceFunction(sVisitProfile);
DestroyServiceFunction(sRemoveFriend);
DestroyServiceFunction(sAddFriend);
+ DestroyServiceFunction(sApproveFriend);
}
void ShowContactMenus(bool show, bool deleted)
@@ -187,7 +197,7 @@ void ShowContactMenus(bool show, bool deleted) {
CLISTMENUITEM item = { sizeof(item) };
item.flags = CMIM_FLAGS;
- if(!show || (i == 3 && !deleted) || (i == 2 && deleted)) // 2 = REMOVE CONTACT; 3 = ADD CONTACT
+ if(!show || (i == 3 && !deleted) || (i == 2 && deleted) || (i == 4 && !deleted)) // 2 = REMOVE CONTACT; 3 = ADD CONTACT; 4 = APPROVE CONTACT
item.flags |= CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM,reinterpret_cast<WPARAM>(g_hMenuItems[i]),
|