diff options
author | George Hazan <george.hazan@gmail.com> | 2024-09-06 15:19:13 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-09-06 15:19:13 +0300 |
commit | 88aa2752d994043599f9662b9fa2b629f07058c2 (patch) | |
tree | cf5416b4267f2b2298e2c0afde24dd269a396320 /protocols/Telegram/src | |
parent | 239ea74ddedb7d3483d08cd599647edcbe4ab9c4 (diff) |
fixes #4618 (Telegram: после успешного логина нужно засерять поля логина и пароля в настройках)
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r-- | protocols/Telegram/src/options.cpp | 9 | ||||
-rw-r--r-- | protocols/Telegram/src/server.cpp | 1 |
2 files changed, 9 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>. void CTelegramProto::OnEndSession(td::ClientManager::Response&)
{
m_bTerminated = true;
+ delSetting(DBKEY_AUTHORIZED);
}
void __cdecl CTelegramProto::ServerThread(void *)
|