tg_cli: keep client settings after reset.

GitOrigin-RevId: c3bd45d9369250f9eb867e9500d6854d0dda19a9
This commit is contained in:
levlam 2020-10-04 01:30:59 +03:00
parent 62d7423bc3
commit 00ff276a1f
1 changed files with 7 additions and 7 deletions

View File

@ -854,6 +854,13 @@ class CliClient final : public Actor {
options.net_query_stats = net_query_stats_;
td_client_ = create_actor<ClientActor>(name, make_unique<TdCallbackImpl>(this, ++generation_), std::move(options));
if (get_chat_list_) {
send_request(td_api::make_object<td_api::getChats>(nullptr, std::numeric_limits<int64>::max(), 0, 100));
}
if (disable_network_) {
send_request(td_api::make_object<td_api::setNetworkType>(td_api::make_object<td_api::networkTypeNone>()));
}
}
void init_td() {
@ -923,13 +930,6 @@ class CliClient final : public Actor {
reactivate_readline();
#endif
Scheduler::subscribe(stdin_.get_poll_info().extract_pollable_fd(this), PollFlags::Read());
if (get_chat_list_) {
send_request(td_api::make_object<td_api::getChats>(nullptr, std::numeric_limits<int64>::max(), 0, 100));
}
if (disable_network_) {
send_request(td_api::make_object<td_api::setNetworkType>(td_api::make_object<td_api::networkTypeNone>()));
}
}
#ifndef USE_READLINE
size_t buffer_pos_ = 0;