From 88aa2752d994043599f9662b9fa2b629f07058c2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 6 Sep 2024 15:19:13 +0300 Subject: =?UTF-8?q?fixes=20#4618=20(Telegram:=20=D0=BF=D0=BE=D1=81=D0=BB?= =?UTF-8?q?=D0=B5=20=D1=83=D1=81=D0=BF=D0=B5=D1=88=D0=BD=D0=BE=D0=B3=D0=BE?= =?UTF-8?q?=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BD=D0=B0=20=D0=BD=D1=83=D0=B6?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=B7=D0=B0=D1=81=D0=B5=D1=80=D1=8F=D1=82=D1=8C?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BB=D1=8F=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B8=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8F=20=D0=B2?= =?UTF-8?q?=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B0=D1=85?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/options.cpp | 9 ++++++++- protocols/Telegram/src/server.cpp | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'protocols/Telegram/src') diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp index bee31419c1..8b3bd7d1e7 100644 --- a/protocols/Telegram/src/options.cpp +++ b/protocols/Telegram/src/options.cpp @@ -52,7 +52,6 @@ public: CreateLink(chkCompressFiles, ppro->m_bCompressFiles); } - btnLogout.Enable(m_proto->getByte(DBKEY_AUTHORIZED)); btnLogout.OnClick = Callback(this, &COptionsDlg::onClick_Logout); cmbCountry.OnChange = Callback(this, &COptionsDlg::onChange_Country); @@ -71,6 +70,11 @@ public: cmbCountry.SetCurSel(idx); } + bool bAuthorized = m_proto->getBool(DBKEY_AUTHORIZED); + btnLogout.Enable(bAuthorized); + edtPhone.Enable(!bAuthorized); + cmbCountry.Enable(!bAuthorized); + onChange_Country(0); return true; } @@ -93,6 +97,9 @@ public: void onClick_Logout(CCtrlButton *) { m_proto->UnregisterSession(); + + edtPhone.Enable(); + cmbCountry.Enable(); } void onChange_Country(CCtrlCombo *) diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 5e71eafedc..e4cd70693a 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -20,6 +20,7 @@ along with this program. If not, see . void CTelegramProto::OnEndSession(td::ClientManager::Response&) { m_bTerminated = true; + delSetting(DBKEY_AUTHORIZED); } void __cdecl CTelegramProto::ServerThread(void *) -- cgit v1.2.3