diff options
author | aunsane <aunsane@gmail.com> | 2018-01-17 21:35:32 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2018-01-17 21:35:54 +0300 |
commit | 8e7d34b4716392f9d9a338e755027cff0a8f3161 (patch) | |
tree | 4415fd81d4389f1a2a5ea2dc0c6b25727f82fdd7 | |
parent | 51d67b220e416aabac680c66e1be306f140221f2 (diff) |
Tox: fixed crash on password deletion #1101
-rw-r--r-- | protocols/Tox/src/tox_connection.cpp | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_menus.cpp | 6 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.cpp | 6 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.h | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/protocols/Tox/src/tox_connection.cpp b/protocols/Tox/src/tox_connection.cpp index 80a84b74c0..f846866242 100644 --- a/protocols/Tox/src/tox_connection.cpp +++ b/protocols/Tox/src/tox_connection.cpp @@ -17,6 +17,8 @@ void CToxProto::TryConnect(Tox *tox) debugLogA(__FUNCTION__": changing status from %i to %i", ID_STATUS_CONNECTING, m_iDesiredStatus); + UpdateStatusMenu(NULL, NULL); + LoadFriendList(tox); return; } 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;
}
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index 237fee5be0..7711d1e62a 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -153,6 +153,9 @@ int CToxProto::SetStatus(int iNewStatus) m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
+
+ UpdateStatusMenu(NULL, NULL);
+
return 0;
}
@@ -163,8 +166,9 @@ int CToxProto::SetStatus(int iNewStatus) if (old_status == ID_STATUS_OFFLINE && !IsOnline()) {
isTerminated = false;
m_iStatus = ID_STATUS_CONNECTING;
- hPollingThread = ForkThreadEx(&CToxProto::PollingThread, nullptr, nullptr);
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
+
+ hPollingThread = ForkThreadEx(&CToxProto::PollingThread, nullptr, nullptr);
return 0;
}
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index ad63844d6a..8ab41afa48 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -143,7 +143,7 @@ private: HGENMENU StatusMenuItems[SMI_MAX];
int OnInitStatusMenu();
- int __cdecl PrebuildStatusMenu(WPARAM, LPARAM);
+ int __cdecl UpdateStatusMenu(WPARAM, LPARAM);
//services
INT_PTR __cdecl SetMyNickname(WPARAM wParam, LPARAM lParam);
|