tdlight is no more

This commit is contained in:
Giuseppe Marino 2021-06-28 13:50:13 +02:00
parent a1510e45bb
commit 3e79d99dfc
No known key found for this signature in database
GPG Key ID: 2BC70C5463357449
5 changed files with 16 additions and 8 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
bin/ bin/
vcpkg/ vcpkg/
/.idea/ /.idea/
.cache/*

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "td"] [submodule "td"]
path = td path = td
url = https://github.com/tdlight-team/tdlight.git url = https://github.com/tdlib/td

2
td

@ -1 +1 @@
Subproject commit 1ea79d273976c22655742d4031ebbe62dba6cd7c Subproject commit cf2be88c34b1b844fb9c2cdf28c3b5f0cce6be6b

View File

@ -2324,9 +2324,11 @@ class Client::JsonChatMember : public Jsonable {
object("inviter", JsonUser(member_->inviter_user_id_, client_)); object("inviter", JsonUser(member_->inviter_user_id_, client_));
} }
/*
if (member_->bot_info_ != nullptr) { if (member_->bot_info_ != nullptr) {
//for the future //for the future
} }
*/
switch (member_->status_->get_id()) { switch (member_->status_->get_id()) {
case td_api::chatMemberStatusCreator::ID: { case td_api::chatMemberStatusCreator::ID: {
@ -2403,8 +2405,8 @@ class Client::JsonChatMembers : public Jsonable {
if (member->member_id_->get_id() != td_api::messageSenderUser::ID) { if (member->member_id_->get_id() != td_api::messageSenderUser::ID) {
continue; continue;
} }
auto user_id = static_cast<const td_api::messageSenderUser *>(member->member_id_.get())->user_id_;
/* /*
auto user_id = static_cast<const td_api::messageSenderUser *>(member->member_id_.get())->user_id_;
bool is_member_bot = member->bot_info_ != nullptr; bool is_member_bot = member->bot_info_ != nullptr;
if (!is_member_bot) { if (!is_member_bot) {
// bot info may be unknown // bot info may be unknown
@ -3743,10 +3745,11 @@ class Client::TdOnGetMemoryStatisticsCallback : public TdQueryCallback {
if (result->get_id() == td_api::error::ID) { if (result->get_id() == td_api::error::ID) {
return fail_query_with_error(std::move(query_), move_object_as<td_api::error>(result)); return fail_query_with_error(std::move(query_), move_object_as<td_api::error>(result));
} }
/*
auto res = move_object_as<td_api::memoryStatistics>(result); auto res = move_object_as<td_api::memoryStatistics>(result);
answer_query(td::JsonRaw(res->statistics_), std::move(query_)); answer_query(td::JsonRaw(res->statistics_), std::move(query_));
*/
} }
private: private:
@ -3959,9 +3962,7 @@ void Client::start_up() {
set_context(context); set_context(context);
set_tag(bot_token_id_); set_tag(bot_token_id_);
auto r_absolute_dir = td::realpath(td::string(".") + TD_DIR_SLASH, true);
CHECK(r_absolute_dir.is_ok());
absolute_dir_ = r_absolute_dir.move_as_ok();
auto suff = bot_token_with_dc_ + TD_DIR_SLASH; auto suff = bot_token_with_dc_ + TD_DIR_SLASH;
if (!parameters_->allow_colon_in_filenames_) { if (!parameters_->allow_colon_in_filenames_) {
for (auto &c : suff) { for (auto &c : suff) {
@ -8072,9 +8073,11 @@ td::Status Client::process_get_chat_member_count_query(PromisedQueryPtr &query)
} }
td::Status Client::process_optimize_memory_query(PromisedQueryPtr &query) { td::Status Client::process_optimize_memory_query(PromisedQueryPtr &query) {
/*
disable_internet_connection(std::move(query), [this](PromisedQueryPtr query) { disable_internet_connection(std::move(query), [this](PromisedQueryPtr query) {
optimize_memory(std::move(query), [this](PromisedQueryPtr query) { enable_internet_connection(std::move(query)); }); optimize_memory(std::move(query), [this](PromisedQueryPtr query) { enable_internet_connection(std::move(query)); });
}); });
*/
return Status::OK(); return Status::OK();
} }
@ -8092,8 +8095,10 @@ void Client::enable_internet_connection(PromisedQueryPtr query) {
template <class OnSuccess> template <class OnSuccess>
void Client::optimize_memory(PromisedQueryPtr query, OnSuccess on_success) { void Client::optimize_memory(PromisedQueryPtr query, OnSuccess on_success) {
/*
send_request(make_object<td_api::optimizeMemory>(), send_request(make_object<td_api::optimizeMemory>(),
std::make_unique<TdOnOptimizeMemoryCallback<OnSuccess>>(this, std::move(query), std::move(on_success))); std::make_unique<TdOnOptimizeMemoryCallback<OnSuccess>>(this, std::move(query), std::move(on_success)));
*/
} }
td::Status Client::process_leave_chat_query(PromisedQueryPtr &query) { td::Status Client::process_leave_chat_query(PromisedQueryPtr &query) {
@ -8626,8 +8631,10 @@ td::Status Client::process_ping_query(PromisedQueryPtr &query) {
} }
td::Status Client::process_get_memory_stats_query(PromisedQueryPtr &query) { td::Status Client::process_get_memory_stats_query(PromisedQueryPtr &query) {
/*
send_request(make_object<td_api::getMemoryStatistics>(), send_request(make_object<td_api::getMemoryStatistics>(),
std::make_unique<TdOnGetMemoryStatisticsCallback>(std::move(query))); std::make_unique<TdOnGetMemoryStatisticsCallback>(std::move(query)));
*/
return Status::OK(); return Status::OK();
} }
//end custom methods impl //end custom methods impl

View File

@ -105,7 +105,7 @@ void ClientManager::send(PromisedQueryPtr query) {
auto webhook_info = parameters_->shared_data_->webhook_db_->get(bot_token_with_dc); auto webhook_info = parameters_->shared_data_->webhook_db_->get(bot_token_with_dc);
if (!webhook_info.empty()) { if (!webhook_info.empty()) {
send_closure(client_info->client_, &Client::send, send_closure(client_info->client_, &Client::send,
get_webhook_restore_query(bot_token_with_dc, query->is_user() webhook_info, parameters_->shared_data_)); get_webhook_restore_query(bot_token_with_dc, query->is_user(), webhook_info, parameters_->shared_data_));
} }
} }