Add "me" to example.
GitOrigin-RevId: 945f8ca30b3ca9f8667d4f481d5bd7070c9b2fcd
This commit is contained in:
parent
da118270bd
commit
7b2684b3ed
@ -65,7 +65,7 @@ class TdExample {
|
||||
process_response(client_->receive(10));
|
||||
} else {
|
||||
std::cerr << "Enter action [q] quit [u] check for updates and request results [c] show chats [m <id> <text>] "
|
||||
"send message [l] logout: "
|
||||
"send message [me] show self [l] logout: "
|
||||
<< std::endl;
|
||||
std::string line;
|
||||
std::getline(std::cin, line);
|
||||
@ -90,6 +90,10 @@ class TdExample {
|
||||
} else if (action == "close") {
|
||||
std::cerr << "Closing..." << std::endl;
|
||||
send_query(td_api::make_object<td_api::close>(), {});
|
||||
} else if (action == "me") {
|
||||
send_query(td_api::make_object<td_api::getMe>(),
|
||||
[this](Object object) { std::cerr << to_string(object) << std::endl; });
|
||||
|
||||
} else if (action == "l") {
|
||||
std::cerr << "Logging out..." << std::endl;
|
||||
send_query(td_api::make_object<td_api::logOut>(), {});
|
||||
|
@ -163,7 +163,7 @@ class Client::Impl final {
|
||||
void on_error(std::uint64_t id, td_api::object_ptr<td_api::error> error) override {
|
||||
output_queue_->writer_put({id, std::move(error)});
|
||||
}
|
||||
~Callback() {
|
||||
~Callback() override {
|
||||
Scheduler::instance()->finish();
|
||||
}
|
||||
|
||||
|
@ -673,7 +673,7 @@ class CliClient final : public Actor {
|
||||
void on_error(uint64 id, tl_object_ptr<td_api::error> error) override {
|
||||
client_->on_error(id, std::move(error));
|
||||
}
|
||||
~TdCallbackImpl() {
|
||||
~TdCallbackImpl() override {
|
||||
client_->on_closed();
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ class TestClient : public Actor {
|
||||
void on_error(uint64 id, tl_object_ptr<td_api::error> error) override {
|
||||
send_closure(client_, &TestClient::on_error, id, std::move(error));
|
||||
}
|
||||
~TdCallbackImpl() {
|
||||
~TdCallbackImpl() override {
|
||||
send_closure(client_, &TestClient::on_closed);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user