Skip to content

Commit

Permalink
fixes #272 - stop connection attempt on wrong database encryption key
Browse files Browse the repository at this point in the history
  • Loading branch information
d99kris committed Aug 10, 2024
1 parent 35f1c95 commit 40d7e37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/common/src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

#pragma once

#define NCHAT_VERSION "5.1.25"
#define NCHAT_VERSION "5.1.26"
12 changes: 7 additions & 5 deletions lib/tgchat/src/tgchat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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> requestAppExitNotify =
std::make_shared<RequestAppExitNotify>(m_ProfileId);
CallMessageHandler(requestAppExitNotify);
}
else
{
OnAuthStateUpdate();
}

m_Running = false;
Status::Clear(Status::FlagConnecting);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/nchat.1
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 40d7e37

Please sign in to comment.