Support updateAutosaveSettings in getCurrentState.
This commit is contained in:
parent
f6616f6ba3
commit
43e5f2aded
@ -354,4 +354,20 @@ void AutosaveManager::send_update_autosave_settings(td_api::object_ptr<td_api::A
|
|||||||
send_closure(G()->td(), &Td::send_update, get_update_autosave_settings(std::move(scope), settings));
|
send_closure(G()->td(), &Td::send_update, get_update_autosave_settings(std::move(scope), settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AutosaveManager::get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const {
|
||||||
|
if (!settings_.are_inited_) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updates.push_back(get_update_autosave_settings(td_api::make_object<td_api::autosaveSettingsScopePrivateChats>(),
|
||||||
|
settings_.user_settings_));
|
||||||
|
updates.push_back(get_update_autosave_settings(td_api::make_object<td_api::autosaveSettingsScopeGroupChats>(),
|
||||||
|
settings_.chat_settings_));
|
||||||
|
updates.push_back(get_update_autosave_settings(td_api::make_object<td_api::autosaveSettingsScopeChannelChats>(),
|
||||||
|
settings_.broadcast_settings_));
|
||||||
|
for (const auto &exception : settings_.exceptions_) {
|
||||||
|
updates.push_back(get_update_autosave_settings(
|
||||||
|
td_api::make_object<td_api::autosaveSettingsScopeChat>(exception.first.get()), exception.second));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace td
|
} // namespace td
|
||||||
|
@ -34,6 +34,8 @@ class AutosaveManager final : public Actor {
|
|||||||
|
|
||||||
void clear_autosave_settings_excpetions(Promise<Unit> &&promise);
|
void clear_autosave_settings_excpetions(Promise<Unit> &&promise);
|
||||||
|
|
||||||
|
void get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct DialogAutosaveSettings {
|
struct DialogAutosaveSettings {
|
||||||
bool are_inited_ = false;
|
bool are_inited_ = false;
|
||||||
|
@ -4299,6 +4299,8 @@ void Td::on_request(uint64 id, const td_api::getCurrentState &request) {
|
|||||||
|
|
||||||
config_manager_.get_actor_unsafe()->get_current_state(updates);
|
config_manager_.get_actor_unsafe()->get_current_state(updates);
|
||||||
|
|
||||||
|
autosave_manager_->get_current_state(updates);
|
||||||
|
|
||||||
// TODO updateFileGenerationStart generation_id:int64 original_path:string destination_path:string conversion:string = Update;
|
// TODO updateFileGenerationStart generation_id:int64 original_path:string destination_path:string conversion:string = Update;
|
||||||
// TODO updateCall call:call = Update;
|
// TODO updateCall call:call = Update;
|
||||||
// TODO updateGroupCall call:groupCall = Update;
|
// TODO updateGroupCall call:groupCall = Update;
|
||||||
|
Loading…
Reference in New Issue
Block a user