Move the rest options to OptionManager::get_current_state.
This commit is contained in:
parent
a333f3fb61
commit
10505fae72
@ -302,7 +302,15 @@ void OptionManager::get_option(const string &name, Promise<td_api::object_ptr<td
|
|||||||
wrap_promise().set_value(Unit());
|
wrap_promise().set_value(Unit());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionManager::get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) {
|
void OptionManager::get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const {
|
||||||
|
updates.push_back(td_api::make_object<td_api::updateOption>(
|
||||||
|
"version", td_api::make_object<td_api::optionValueString>(Td::TDLIB_VERSION)));
|
||||||
|
|
||||||
|
updates.push_back(
|
||||||
|
td_api::make_object<td_api::updateOption>("online", td_api::make_object<td_api::optionValueBoolean>(td_->is_online())));
|
||||||
|
updates.push_back(td_api::make_object<td_api::updateOption>(
|
||||||
|
"unix_time", td_api::make_object<td_api::optionValueInteger>(G()->unix_time())));
|
||||||
|
|
||||||
for (const auto &option : G()->shared_config().get_options()) {
|
for (const auto &option : G()->shared_config().get_options()) {
|
||||||
if (!is_internal_option(option.first)) {
|
if (!is_internal_option(option.first)) {
|
||||||
updates.push_back(td_api::make_object<td_api::updateOption>(
|
updates.push_back(td_api::make_object<td_api::updateOption>(
|
||||||
|
@ -34,7 +34,7 @@ class OptionManager final : public Actor {
|
|||||||
|
|
||||||
static void clear_options();
|
static void clear_options();
|
||||||
|
|
||||||
static void get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates);
|
void get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void tear_down() final;
|
void tear_down() final;
|
||||||
|
@ -4398,15 +4398,7 @@ void Td::on_request(uint64 id, td_api::confirmQrCodeAuthentication &request) {
|
|||||||
void Td::on_request(uint64 id, const td_api::getCurrentState &request) {
|
void Td::on_request(uint64 id, const td_api::getCurrentState &request) {
|
||||||
vector<td_api::object_ptr<td_api::Update>> updates;
|
vector<td_api::object_ptr<td_api::Update>> updates;
|
||||||
|
|
||||||
updates.push_back(td_api::make_object<td_api::updateOption>(
|
option_manager_->get_current_state(updates);
|
||||||
"version", td_api::make_object<td_api::optionValueString>(TDLIB_VERSION)));
|
|
||||||
|
|
||||||
updates.push_back(
|
|
||||||
td_api::make_object<td_api::updateOption>("online", make_tl_object<td_api::optionValueBoolean>(is_online_)));
|
|
||||||
updates.push_back(td_api::make_object<td_api::updateOption>(
|
|
||||||
"unix_time", make_tl_object<td_api::optionValueInteger>(G()->unix_time())));
|
|
||||||
|
|
||||||
OptionManager::get_current_state(updates);
|
|
||||||
|
|
||||||
auto state = auth_manager_->get_current_authorization_state_object();
|
auto state = auth_manager_->get_current_authorization_state_object();
|
||||||
if (state != nullptr) {
|
if (state != nullptr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user