summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_menus.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-12-20 22:15:46 +0300
committeraunsane <aunsane@gmail.com>2017-12-20 22:17:00 +0300
commitc8548c468436fc3a2fccc00be9f48e6b7f0a1df2 (patch)
tree0d6cd519060f7783a0820d66462b037fd2a5c182 /protocols/Tox/src/tox_menus.cpp
parentbe36bd4b6641ebe418724aad1d867236794ffaa1 (diff)
Tox: added ability to encrypt profile
Diffstat (limited to 'protocols/Tox/src/tox_menus.cpp')
-rw-r--r--protocols/Tox/src/tox_menus.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/protocols/Tox/src/tox_menus.cpp b/protocols/Tox/src/tox_menus.cpp
index 205fb11979..ffa47b8621 100644
--- a/protocols/Tox/src/tox_menus.cpp
+++ b/protocols/Tox/src/tox_menus.cpp
@@ -32,7 +32,7 @@ int CToxProto::PrebuildContactMenu(WPARAM hContact, LPARAM lParam)
return proto ? proto->OnPrebuildContactMenu(hContact, lParam) : 0;
}
-void CToxProto::InitMenus()
+void CToxProto::InitContactMenu()
{
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, &CToxProto::PrebuildContactMenu);
@@ -58,8 +58,17 @@ void CToxProto::InitMenus()
CreateServiceFunction(mi.pszService, GlobalService<&CToxProto::OnGrantAuth>);
}
+int CToxProto::PrebuildStatusMenu(WPARAM, LPARAM)
+{
+ bool isOnline = IsOnline();
+ Menu_EnableItem(StatusMenuItems[SMI_PASSWORD_CHANGE], isOnline);
+ return 0;
+}
+
int CToxProto::OnInitStatusMenu()
{
+ HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CToxProto::PrebuildStatusMenu);
+
CMenuItem mi;
mi.flags = CMIF_UNICODE;
mi.root = Menu_GetProtocolRoot(this);
@@ -69,16 +78,14 @@ int CToxProto::OnInitStatusMenu()
CreateProtoService(mi.pszService, &CToxProto::OnCopyToxID);
mi.name.w = LPGENW("Copy Tox ID");
mi.position = SMI_POSITION + SMI_TOXID_COPY;
- Menu_AddProtoMenuItem(&mi, m_szModuleName);
-
- // Create group chat command
- /*
- mi.pszService = "/CreateChatRoom";
- CreateProtoService(mi.pszService, &CToxProto::OnCreateChatRoom);
- mi.name.w = LPGENW("Create group chat");
- mi.position = SMI_POSITION + SMI_GROUPCHAT_CREATE;
- mi.hIcolibItem = Skin_GetIconHandle("conference");
- HGENMENU hCreateChatRoom = Menu_AddProtoMenuItem(&mi, m_szModuleName);*/
+ StatusMenuItems[SMI_TOXID_COPY] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
+
+ // Change password command
+ mi.pszService = "/ChangePassword";
+ CreateProtoService(mi.pszService, &CToxProto::OnChangePassword);
+ mi.name.w = LPGENW("Change password");
+ mi.position = SMI_POSITION + SMI_PASSWORD_CHANGE;
+ StatusMenuItems[SMI_PASSWORD_CHANGE] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
return 0;
}