From 8e7d34b4716392f9d9a338e755027cff0a8f3161 Mon Sep 17 00:00:00 2001 From: aunsane Date: Wed, 17 Jan 2018 21:35:32 +0300 Subject: Tox: fixed crash on password deletion #1101 --- protocols/Tox/src/tox_menus.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'protocols/Tox/src/tox_menus.cpp') diff --git a/protocols/Tox/src/tox_menus.cpp b/protocols/Tox/src/tox_menus.cpp index 34b3047fb4..88d7129713 100644 --- a/protocols/Tox/src/tox_menus.cpp +++ b/protocols/Tox/src/tox_menus.cpp @@ -58,7 +58,7 @@ void CToxProto::InitContactMenu() CreateServiceFunction(mi.pszService, GlobalService<&CToxProto::OnGrantAuth>); } -int CToxProto::PrebuildStatusMenu(WPARAM, LPARAM) +int CToxProto::UpdateStatusMenu(WPARAM, LPARAM) { bool isOnline = IsOnline(); Menu_EnableItem(StatusMenuItems[SMI_PASSWORD], isOnline); @@ -77,7 +77,7 @@ int CToxProto::PrebuildStatusMenu(WPARAM, LPARAM) int CToxProto::OnInitStatusMenu() { - HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CToxProto::PrebuildStatusMenu); + //HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CToxProto::UpdateStatusMenu); CMenuItem mi; mi.flags = CMIF_UNICODE; @@ -117,5 +117,7 @@ int CToxProto::OnInitStatusMenu() mi.position = SMI_PASSWORD_REMOVE; StatusMenuItems[SMI_PASSWORD_REMOVE] = Menu_AddProtoMenuItem(&mi, m_szModuleName); + UpdateStatusMenu(NULL, NULL); + return 0; } -- cgit v1.2.3