summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/Discord/src/connection.cpp2
-rw-r--r--protocols/Discord/src/mfa.cpp7
-rw-r--r--protocols/Discord/src/proto.h2
3 files changed, 11 insertions, 0 deletions
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<CDiscordProto>
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