Update version to 5.3.1, Update tdlib to 1.7.6.

This commit is contained in:
Andrea Cavalli 2021-08-05 11:29:14 +02:00
commit 4a4ef1b3ca
6 changed files with 22 additions and 6 deletions

View File

@ -6,7 +6,7 @@ if (POLICY CMP0065)
cmake_policy(SET CMP0065 NEW) cmake_policy(SET CMP0065 NEW)
endif() endif()
project(TelegramBotApi VERSION 5.3 LANGUAGES CXX) project(TelegramBotApi VERSION 5.3.1 LANGUAGES CXX)
add_subdirectory(td EXCLUDE_FROM_ALL) add_subdirectory(td EXCLUDE_FROM_ALL)

2
td

@ -1 +1 @@
Subproject commit cf2be88c34b1b844fb9c2cdf28c3b5f0cce6be6b Subproject commit f8ab675ad14080b1609b5904c366052c814d1788

View File

@ -81,6 +81,19 @@ void Client::fail_query_with_error(PromisedQueryPtr query, int32 error_code, Sli
} }
error_code = 400; error_code = 400;
} else if (error_code == 403) {
bool is_server_error = true;
for (auto c : error_message) {
if (c == '_' || ('A' <= c && c <= 'Z') || td::is_digit(c)) {
continue;
}
is_server_error = false;
break;
}
if (is_server_error) {
error_code = 400;
}
} }
if (error_code == 400) { if (error_code == 400) {
if (!default_message.empty()) { if (!default_message.empty()) {
@ -10192,7 +10205,7 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr<td_api::me
} }
/* /*
if (message->ttl_ > 0 && message->ttl_expires_in_ == 0) { if (message->ttl_ > 0 && message->ttl_expires_in_ == message->ttl_) {
return true; return true;
} }
*/ */

View File

@ -397,6 +397,7 @@ void ClientManager::start_up() {
// init tqueue // init tqueue
{ {
auto load_start_time = td::Time::now();
auto tqueue_binlog = td::make_unique<td::TQueueBinlog<td::Binlog>>(); auto tqueue_binlog = td::make_unique<td::TQueueBinlog<td::Binlog>>();
auto binlog = td::make_unique<td::Binlog>(); auto binlog = td::make_unique<td::Binlog>();
auto tqueue = td::TQueue::create(); auto tqueue = td::TQueue::create();
@ -413,7 +414,6 @@ void ClientManager::start_up() {
}) })
.ensure(); .ensure();
tqueue_binlog.reset(); tqueue_binlog.reset();
LOG(WARNING) << "Loaded " << loaded_event_count << " TQueue events";
if (!failed_to_replay_log_event_ids.empty()) { if (!failed_to_replay_log_event_ids.empty()) {
LOG(ERROR) << "Failed to replay " << failed_to_replay_log_event_ids.size() << " TQueue events"; LOG(ERROR) << "Failed to replay " << failed_to_replay_log_event_ids.size() << " TQueue events";
@ -428,6 +428,9 @@ void ClientManager::start_up() {
tqueue->set_callback(std::move(concurrent_tqueue_binlog)); tqueue->set_callback(std::move(concurrent_tqueue_binlog));
parameters_->shared_data_->tqueue_ = std::move(tqueue); parameters_->shared_data_->tqueue_ = std::move(tqueue);
LOG(WARNING) << "Loaded " << loaded_event_count << " TQueue events in " << (td::Time::now() - load_start_time)
<< " seconds";
} }
// init webhook_db and user_db // init webhook_db and user_db

View File

@ -126,7 +126,7 @@ void Query::send_request_stat() const {
void Query::send_response_stat() const { void Query::send_response_stat() const {
auto now = td::Time::now(); auto now = td::Time::now();
if (now - start_timestamp_ >= 100.0) { if (now - start_timestamp_ >= 100.0 && !is_internal_) {
LOG(WARNING) << "Answer too old query with code " << http_status_code_ << " and answer size " << answer_.size() LOG(WARNING) << "Answer too old query with code " << http_status_code_ << " and answer size " << answer_.size()
<< ": " << *this; << ": " << *this;
} }

View File

@ -192,7 +192,7 @@ int main(int argc, char *argv[]) {
auto start_time = td::Time::now(); auto start_time = td::Time::now();
auto shared_data = std::make_shared<SharedData>(); auto shared_data = std::make_shared<SharedData>();
auto parameters = std::make_unique<ClientParameters>(); auto parameters = std::make_unique<ClientParameters>();
parameters->version_ = "5.3"; parameters->version_ = "5.3.1";
parameters->shared_data_ = shared_data; parameters->shared_data_ = shared_data;
parameters->start_time_ = start_time; parameters->start_time_ = start_time;
auto net_query_stats = td::create_net_query_stats(); auto net_query_stats = td::create_net_query_stats();