From 40d7e379e6ae4a265a505c692e2da56636a18083 Mon Sep 17 00:00:00 2001 From: Kristofer Berggren Date: Sat, 10 Aug 2024 08:43:20 +0800 Subject: [PATCH] fixes #272 - stop connection attempt on wrong database encryption key --- lib/common/src/version.h | 2 +- lib/tgchat/src/tgchat.cpp | 12 +++++++----- src/nchat.1 | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/common/src/version.h b/lib/common/src/version.h index 1313c55b..dc645c62 100644 --- a/lib/common/src/version.h +++ b/lib/common/src/version.h @@ -7,4 +7,4 @@ #pragma once -#define NCHAT_VERSION "5.1.25" +#define NCHAT_VERSION "5.1.26" diff --git a/lib/tgchat/src/tgchat.cpp b/lib/tgchat/src/tgchat.cpp index 1fe95322..2a78112b 100644 --- a/lib/tgchat/src/tgchat.cpp +++ b/lib/tgchat/src/tgchat.cpp @@ -2125,6 +2125,10 @@ void TgChat::Impl::OnAuthStateUpdate() { // use saved local encryption key key = m_Config.Get("local_key"); + if (key.empty()) + { + LOG_WARNING("local_key is not set"); + } } const std::string dbPath(m_ProfileDir + std::string("/tdlib")); @@ -2197,17 +2201,15 @@ void TgChat::Impl::CheckAuthError(Object object) m_IsSetup = false; m_IsReinit = false; - m_Running = false; LOG_TRACE("request app exit"); std::shared_ptr requestAppExitNotify = std::make_shared(m_ProfileId); CallMessageHandler(requestAppExitNotify); } - else - { - OnAuthStateUpdate(); - } + + m_Running = false; + Status::Clear(Status::FlagConnecting); } } diff --git a/src/nchat.1 b/src/nchat.1 index a098ff8c..1165985c 100644 --- a/src/nchat.1 +++ b/src/nchat.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man. -.TH NCHAT "1" "August 2024" "nchat 5.1.25" "User Commands" +.TH NCHAT "1" "August 2024" "nchat 5.1.26" "User Commands" .SH NAME nchat \- ncurses chat .SH SYNOPSIS