summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-09 16:13:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-09 16:13:50 +0300
commitd15bd517fb0eb4bbdb1b118b44398b00bc8f6d6a (patch)
treeead9ec16a070ed6237975fe00a368fec2491e1ad /protocols/FacebookRM/src/proto.cpp
parentb407cbb7ad5cf00f0420fd91b82969ffcbaba5b5 (diff)
all duplicate "Request auth", "Grant auth" & "Revoke auth" menu items eliminated
Diffstat (limited to 'protocols/FacebookRM/src/proto.cpp')
-rw-r--r--protocols/FacebookRM/src/proto.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index be0f917120..b40314a8e3 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -57,6 +57,10 @@ FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) :
CreateProtoService(PS_JOINCHAT, &FacebookProto::OnJoinChat);
CreateProtoService(PS_LEAVECHAT, &FacebookProto::OnLeaveChat);
+ CreateProtoService(PS_MENU_REQAUTH, &FacebookProto::RequestFriendship);
+ CreateProtoService(PS_MENU_GRANTAUTH, &FacebookProto::ApproveFriendship);
+ CreateProtoService(PS_MENU_REVOKEAUTH, &FacebookProto::CancelFriendship);
+
HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &FacebookProto::OnBuildStatusMenu);
HookProtoEvent(ME_OPT_INITIALISE, &FacebookProto::OnOptionsInit);
HookProtoEvent(ME_IDLE_CHANGED, &FacebookProto::OnIdleChanged);
@@ -769,13 +773,11 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR FacebookProto::RequestFriendship(WPARAM wParam, LPARAM)
+INT_PTR FacebookProto::RequestFriendship(WPARAM hContact, LPARAM)
{
- if (wParam == 0 || isOffline())
+ if (hContact == 0 || isOffline())
return 1;
- MCONTACT hContact = MCONTACT(wParam);
-
ptrA id(getStringA(hContact, FACEBOOK_KEY_ID));
if (id == nullptr)
return 1;
@@ -784,23 +786,21 @@ INT_PTR FacebookProto::RequestFriendship(WPARAM wParam, LPARAM)
return 0;
}
-INT_PTR FacebookProto::ApproveFriendship(WPARAM wParam, LPARAM)
+INT_PTR FacebookProto::ApproveFriendship(WPARAM hContact, LPARAM)
{
- if (wParam == 0 || isOffline())
+ if (hContact == 0 || isOffline())
return 1;
- MCONTACT *hContact = new MCONTACT((MCONTACT)wParam);
- ForkThread(&FacebookProto::ApproveContactToServer, hContact);
+ ForkThread(&FacebookProto::ApproveContactToServer, new MCONTACT(hContact));
return 0;
}
-INT_PTR FacebookProto::DenyFriendship(WPARAM wParam, LPARAM)
+INT_PTR FacebookProto::DenyFriendship(WPARAM hContact, LPARAM)
{
- if (wParam == 0 || isOffline())
+ if (hContact == 0 || isOffline())
return 1;
- MCONTACT *hContact = new MCONTACT((MCONTACT)wParam);
- ForkThread(&FacebookProto::IgnoreFriendshipRequest, hContact);
+ ForkThread(&FacebookProto::IgnoreFriendshipRequest, new MCONTACT(hContact));
return 0;
}