From e836a46e4e0d1e9bddd4cd46b672ce17fcfd579f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 18 Oct 2024 19:04:38 +0300 Subject: =?UTF-8?q?fixes=20#4645=20(Telegram:=20=D0=BD=D0=B5=D0=B2=D0=BE?= =?UTF-8?q?=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=20=D1=81=D0=BA=D0=BE=D1=80?= =?UTF-8?q?=D1=80=D0=B5=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D1=87=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=B2=D0=B2=D0=B5=D0=B4=D1=91=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BD?= =?UTF-8?q?=D0=BE=D0=BC=D0=B5=D1=80=20=D1=82=D0=B5=D0=BB=D0=B5=D1=84=D0=BE?= =?UTF-8?q?=D0=BD=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/server.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'protocols') diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 1f5c204abe..0bce32d512 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -27,6 +27,7 @@ void __cdecl CTelegramProto::ServerThread(void *) { m_botIds.clear(); + bool bWasAuthorized = getBool(DBKEY_AUTHORIZED); m_bTerminated = m_bAuthorized = false; m_pClientManager = std::make_unique(); m_iClientId = m_pClientManager->create_client_id(); @@ -52,11 +53,13 @@ void __cdecl CTelegramProto::ServerThread(void *) SendQuery(new TD::addProxy(nluSettings.szProxyServer, nluSettings.wProxyPort, true, std::move(proxyType))); } - while (!m_bTerminated) { + while (!m_bTerminated) ProcessResponse(m_pClientManager->receive(1)); - } m_pClientManager = std::move(nullptr); + + if (!bWasAuthorized && !getBool(DBKEY_AUTHORIZED)) + OnErase(); } void CTelegramProto::UnregisterSession() -- cgit v1.2.3