From a1a0b8dcc8ea3a96a03476a2002e09aeb7608736 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 27 Jan 2024 20:44:44 +0300 Subject: =?UTF-8?q?fixes=20#4136=20(Discord:=20=D0=B5=D1=81=D0=BB=D0=B8=20?= =?UTF-8?q?=D0=B8=D0=B3=D0=BD=D0=BE=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D1=8B=202FA?= =?UTF-8?q?,=20=D1=82=D0=BE=20=D0=BE=D0=BD=D0=B8=20=D0=BF=D0=BB=D0=BE?= =?UTF-8?q?=D0=B4=D1=8F=D1=82=D1=81=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Discord/src/connection.cpp | 2 ++ protocols/Discord/src/mfa.cpp | 7 +++++++ protocols/Discord/src/proto.h | 2 ++ 3 files changed, 11 insertions(+) diff --git a/protocols/Discord/src/connection.cpp b/protocols/Discord/src/connection.cpp index 2e740ba4c1..2fe771c0ed 100644 --- a/protocols/Discord/src/connection.cpp +++ b/protocols/Discord/src/connection.cpp @@ -89,6 +89,8 @@ void CDiscordProto::ShutdownSession() debugLogA("CDiscordProto::ShutdownSession"); // shutdown all resources + if (pMfaDialog) + pMfaDialog->Close(); if (m_hWorkerThread) SetEvent(m_evRequestsQueue); if (m_hGatewayConnection) diff --git a/protocols/Discord/src/mfa.cpp b/protocols/Discord/src/mfa.cpp index 85b87a110a..3a3032e529 100644 --- a/protocols/Discord/src/mfa.cpp +++ b/protocols/Discord/src/mfa.cpp @@ -58,6 +58,8 @@ public: bool OnInitDialog() override { + m_proto->pMfaDialog = this; + if (m_bHasTotp) cmbAnother.AddString(TranslateT("Use authentication app"), 0); if (m_bHasSms) @@ -84,6 +86,11 @@ public: return false; } + void OnDestroy() override + { + m_proto->pMfaDialog = nullptr; + } + void onChange_Combo(CCtrlCombo *) { edtCode.SetText(L""); diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h index 4c9f74e181..38bf253ae1 100644 --- a/protocols/Discord/src/proto.h +++ b/protocols/Discord/src/proto.h @@ -281,6 +281,8 @@ class CDiscordProto : public PROTO void Push(AsyncHttpRequest *pReq, int iTimeout = 10000); void SaveToken(const JSONNode &data); + CDlgBase *pMfaDialog; + HANDLE m_hWorkerThread; // worker thread handle HNETLIBCONN m_hAPIConnection; // working connection -- cgit v1.2.3