Add TranscriptionManager::get_current_state.
This commit is contained in:
parent
e5f457c30f
commit
922a0428ed
@ -4419,6 +4419,8 @@ void Td::on_request(uint64 id, const td_api::getCurrentState &request) {
|
||||
|
||||
config_manager_.get_actor_unsafe()->get_current_state(updates);
|
||||
|
||||
transcription_manager_->get_current_state(updates);
|
||||
|
||||
autosave_manager_->get_current_state(updates);
|
||||
|
||||
account_manager_->get_current_state(updates);
|
||||
|
@ -20,6 +20,9 @@ void TranscriptionManager::tear_down() {
|
||||
}
|
||||
|
||||
void TranscriptionManager::on_update_trial_parameters(int32 weekly_number, int32 duration_max, int32 cooldown_until) {
|
||||
if (!td_->auth_manager_->is_authorized()) {
|
||||
return;
|
||||
}
|
||||
CHECK(!td_->auth_manager_->is_bot());
|
||||
weekly_number = max(0, weekly_number);
|
||||
duration_max = max(0, duration_max);
|
||||
@ -44,14 +47,23 @@ void TranscriptionManager::on_update_trial_parameters(int32 weekly_number, int32
|
||||
}
|
||||
|
||||
void TranscriptionManager::send_update_speech_recognition_trial() const {
|
||||
CHECK(!td_->auth_manager_->is_bot());
|
||||
send_closure(G()->td(), &Td::send_update, get_update_speech_recognition_trial_object());
|
||||
}
|
||||
|
||||
td_api::object_ptr<td_api::updateSpeechRecognitionTrial>
|
||||
TranscriptionManager::get_update_speech_recognition_trial_object() const {
|
||||
CHECK(td_->auth_manager_->is_authorized());
|
||||
CHECK(!td_->auth_manager_->is_bot());
|
||||
return td_api::make_object<td_api::updateSpeechRecognitionTrial>(trial_duration_max_, trial_weekly_number_,
|
||||
trial_left_tries_, trial_cooldown_until_);
|
||||
}
|
||||
|
||||
void TranscriptionManager::get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const {
|
||||
if (!td_->auth_manager_->is_authorized() || td_->auth_manager_->is_bot()) {
|
||||
return;
|
||||
}
|
||||
|
||||
updates.push_back(get_update_speech_recognition_trial_object());
|
||||
}
|
||||
|
||||
} // namespace td
|
||||
|
@ -22,6 +22,8 @@ class TranscriptionManager final : public Actor {
|
||||
|
||||
void on_update_trial_parameters(int32 weekly_number, int32 duration_max, int32 cooldown_until);
|
||||
|
||||
void get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const;
|
||||
|
||||
private:
|
||||
void tear_down() final;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user