summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_menus.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-05-03 08:57:07 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-05-03 08:57:07 +0000
commit6b0e2e70e2cf701dfb3338379598efe2f168e859 (patch)
treef2de5b3fe9e13d5948ebeb86a18cd9327d729b1d /protocols/Steam/src/steam_menus.cpp
parent70436074ae8f66a092d0212fb8b99b94d0fd03a6 (diff)
Steam: added "Request authorization" contact menu item
git-svn-id: http://svn.miranda-ng.org/main/trunk@9109 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_menus.cpp')
-rw-r--r--protocols/Steam/src/steam_menus.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp
index 9ce56ec84c..be3a2ed181 100644
--- a/protocols/Steam/src/steam_menus.cpp
+++ b/protocols/Steam/src/steam_menus.cpp
@@ -18,6 +18,13 @@ INT_PTR CSteamProto::MenuChooseService(WPARAM wParam, LPARAM lParam)
return 0;
}
+int CSteamProto::AuthRequestCommand(WPARAM hContact, LPARAM)
+{
+ CallContactService(hContact, PSS_AUTHREQUEST, 0, 0);
+
+ return 0;
+}
+
int CSteamProto::JoinToGameCommand(WPARAM hContact, LPARAM)
{
char url[MAX_PATH];
@@ -38,6 +45,10 @@ int CSteamProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
return 0;
//bool ctrlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
+
+ bool authNeeded = getBool(hContact, "Auth", 0);
+ Menu_ShowItem(contactMenuItems[CMI_AUTH_REQUEST], authNeeded);
+
DWORD gameId = getDword(hContact, "GameID", 0);
Menu_ShowItem(contactMenuItems[CMI_JOIN_GAME], gameId > 0);
@@ -61,13 +72,23 @@ void CSteamProto::InitMenus()
// Contact menu initialization
CLISTMENUITEM mi = { 0 };
mi.cbSize = sizeof(CLISTMENUITEM);
- mi.flags = CMIF_TCHAR | CMIF_NOTOFFLINE;
+ mi.flags = CMIF_TCHAR;
+
+ // "Join to game"
+ mi.pszService = MODULE"/AuthRequest";
+ mi.ptszName = LPGENT("Request authorization");
+ mi.position = -201001000 + CMI_AUTH_REQUEST;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_AUTH_REQUEST);
+ contactMenuItems[CMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
+ CreateServiceFunction(mi.pszService, GlobalService<&CSteamProto::AuthRequestCommand>);
+
+ mi.flags |= CMIF_NOTOFFLINE;
// "Join to game"
mi.pszService = MODULE"/JoinToGame";
mi.ptszName = LPGENT("Join to game");
mi.position = -200001000 + CMI_JOIN_GAME;
- //mi.icolibItem = CSkypeProto::GetSkinIconHandle("block");
+ mi.icolibItem = NULL;
contactMenuItems[CMI_JOIN_GAME] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSteamProto::JoinToGameCommand>);
}