Add td_api::updateFileRemovedFromDownloads.

This commit is contained in:
levlam 2022-03-01 15:44:25 +03:00
parent f993bebc2f
commit 9ead1f0b34
3 changed files with 6 additions and 0 deletions

View File

@ -106,6 +106,7 @@ class DownloadManagerImpl final : public DownloadManager {
remove_from_db(file_info);
files_.erase(file_info.download_id);
callback_->update_file_removed(file_id);
return Status::OK();
}

View File

@ -47,6 +47,7 @@ class DownloadManager : public Actor {
public:
virtual ~Callback() = default;
virtual void update_counters(Counters counters) = 0;
virtual void update_file_removed(FileId file_id) = 0;
virtual void start_file(FileId file_id, int8 priority) = 0;
virtual void pause_file(FileId file_id) = 0;
virtual void delete_file(FileId file_id) = 0;

View File

@ -3980,6 +3980,10 @@ void Td::init_managers() {
void update_counters(DownloadManager::Counters counters) final {
send_closure(G()->td(), &Td::send_update, counters.get_update_file_downloads_object());
}
void update_file_removed(FileId file_id) final {
send_closure(G()->td(), &Td::send_update,
td_api::make_object<td_api::updateFileRemovedFromDownloads>(file_id.get()));
}
void start_file(FileId file_id, int8 priority) final {
send_closure(G()->file_manager(), &FileManager::download, file_id, make_download_file_callback(), priority,
FileManager::KEEP_DOWNLOAD_OFFSET, FileManager::IGNORE_DOWNLOAD_LIMIT);