summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/server.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-04-07 20:43:46 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-04-07 20:43:46 +0300
commit014c4b42f3916960a316f892b105fb2585f6e4ce (patch)
treecb5ea9818c729195db111df06424004f9121426b /protocols/Telegram/src/server.cpp
parentc22018804a628a2577a853cdb203c8b45890a4ca (diff)
fixes #4333 (Telegram: кнопка "Log out" роняет приложение, если протокол в сети)
Diffstat (limited to 'protocols/Telegram/src/server.cpp')
-rw-r--r--protocols/Telegram/src/server.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index f9ed581e50..31a4010983 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -62,7 +62,12 @@ void CTelegramProto::UnregisterSession()
{
if (getByte(DBKEY_AUTHORIZED)) {
m_bUnregister = true;
- ForkThread(&CTelegramProto::ServerThread);
+
+ if (m_pClientManager) {
+ SendQuery(new TD::terminateSession());
+ SendQuery(new TD::logOut(), &CTelegramProto::OnEndSession);
+ }
+ else ForkThread(&CTelegramProto::ServerThread);
}
}