diff options
Diffstat (limited to 'protocols')
-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 *)
|