diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-06-21 17:46:15 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-06-21 17:46:15 +0000 |
commit | 7941d6d1a2ba1fac7abf817149360d73ed79c799 (patch) | |
tree | d336c78e18e291ea4e5c755ddf9a5f65fa163a80 /protocols/Steam/src/steam_menus.cpp | |
parent | 13ec12177636fb42c9692664d0f48bd3be2a7fc0 (diff) |
Steam: first approach to block list support
git-svn-id: http://svn.miranda-ng.org/main/trunk@9546 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_menus.cpp')
-rw-r--r-- | protocols/Steam/src/steam_menus.cpp | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index f0a2e19b21..2f5e114cca 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -50,6 +50,18 @@ int CSteamProto::JoinToGameCommand(WPARAM hContact, LPARAM) return 0;
}
+int CSteamProto::OpenBlockListCommand(WPARAM, LPARAM)
+{
+ ptrA token(getStringA("TokenSecret"));
+ ptrA steamId(getStringA("SteamID"));
+
+ PushRequest(
+ new SteamWebApi::GetFriendListRequest(token, steamId, "ignoredfriend"),
+ &CSteamProto::OnGotBlockList);
+
+ return 0;
+}
+
int CSteamProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
{
MCONTACT hContact = (MCONTACT)wParam;
@@ -82,6 +94,44 @@ int CSteamProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam) return (ppro) ? ppro->OnPrebuildContactMenu(wParam, lParam) : 0;
}
+void CSteamProto::OnInitStatusMenu()
+{
+ char text[200];
+ strcpy(text, m_szModuleName);
+ char* tDest = text + strlen(text);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.pszService = text;
+
+ HGENMENU hSteamRoot = MO_GetProtoRootMenu(m_szModuleName);
+ if (!hSteamRoot)
+ {
+ mi.ptszName = m_tszUserName;
+ mi.position = -1999901006;
+ mi.hParentMenu = HGENMENU_ROOT;
+ mi.flags = CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ //mi.icolibItem = NULL;
+ hSteamRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
+ }
+ else
+ {
+ if (m_hMenuRoot)
+ CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)m_hMenuRoot, 0);
+ m_hMenuRoot = NULL;
+ }
+
+ mi.hParentMenu = hSteamRoot;
+ mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR;
+
+ // Show block list
+ strcpy(tDest, "/BlockList");
+ CreateProtoService(tDest, &CSteamProto::OpenBlockListCommand);
+ mi.ptszName = LPGENT("Blocked contacts");
+ mi.position = 200000 + SMI_BLOCKED_LIST;
+ //mi.icolibItem = NULL;
+ Menu_AddProtoMenuItem(&mi);
+}
+
void CSteamProto::InitMenus()
{
hChooserMenu = MO_CreateMenuObject("SkypeAccountChooser", LPGEN("Steam menu chooser"), 0, "Steam/MenuChoose");
@@ -121,5 +171,8 @@ void CSteamProto::InitMenus() void CSteamProto::UninitMenus()
{
- CallService(MS_CLIST_REMOVETRAYMENUITEM, (WPARAM)contactMenuItems[CMI_JOIN_GAME], 0);
-}
\ No newline at end of file + CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)contactMenuItems[CMI_AUTH_REQUEST], 0);
+ CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)contactMenuItems[CMI_BLOCK], 0);
+ CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)contactMenuItems[CMI_JOIN_GAME], 0);
+}
+
|