From 0fc3b3adc6da3c4fe354efed388b693ac1acdea0 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 19 Dec 2023 14:33:21 +0300 Subject: [PATCH] Improve names of background-related methods. --- td/generate/scheme/td_api.tl | 20 ++++++++++---------- td/telegram/Td.cpp | 8 ++++---- td/telegram/Td.h | 8 ++++---- td/telegram/cli.cpp | 16 ++++++++-------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 54b6d236f..9a1efe5b6 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -9131,26 +9131,26 @@ createInvoiceLink invoice:InputMessageContent = HttpUrl; getSupportUser = User; -//@description Returns backgrounds installed by the user @for_dark_theme Pass true to order returned backgrounds for a dark theme -getBackgrounds for_dark_theme:Bool = Backgrounds; - //@description Constructs a persistent HTTP URL for a background @name Background name @type Background type getBackgroundUrl name:string type:BackgroundType = HttpUrl; //@description Searches for a background by its name @name The name of the background searchBackground name:string = Background; -//@description Changes the background selected by the user; adds background to the list of installed backgrounds -//@background The input background to use; pass null to create a new filled background or to remove the current background -//@type Background type; pass null to use the default type of the remote background or to remove the current background -//@for_dark_theme Pass true if the background is changed for a dark theme -setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; +//@description Sets default background for chats; adds the background to the list of installed backgrounds +//@background The input background to use; pass null to create a new filled background +//@type Background type; pass null to use the default type of the remote background +//@for_dark_theme Pass true if the background is set for a dark theme +setDefaultBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; + +//@description Returns backgrounds installed by the user @for_dark_theme Pass true to order returned backgrounds for a dark theme +getInstalledBackgrounds for_dark_theme:Bool = Backgrounds; //@description Removes background from the list of installed backgrounds @background_id The background identifier -removeBackground background_id:int64 = Ok; +removeInstalledBackground background_id:int64 = Ok; //@description Resets list of installed backgrounds to its default value -resetBackgrounds = Ok; +resetInstalledBackgrounds = Ok; //@description Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization @only_local Pass true to get only locally available information without sending network requests diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index de0068bbf..ea7303ce3 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -8760,7 +8760,7 @@ void Td::on_request(uint64 id, const td_api::getSupportUser &request) { contacts_manager_->get_support_user(std::move(promise)); } -void Td::on_request(uint64 id, const td_api::getBackgrounds &request) { +void Td::on_request(uint64 id, const td_api::getInstalledBackgrounds &request) { CHECK_IS_USER(); CREATE_REQUEST_PROMISE(); background_manager_->get_backgrounds(request.for_dark_theme_, std::move(promise)); @@ -8783,20 +8783,20 @@ void Td::on_request(uint64 id, td_api::searchBackground &request) { CREATE_REQUEST(SearchBackgroundRequest, std::move(request.name_)); } -void Td::on_request(uint64 id, td_api::setBackground &request) { +void Td::on_request(uint64 id, td_api::setDefaultBackground &request) { CHECK_IS_USER(); CREATE_REQUEST_PROMISE(); background_manager_->set_background(request.background_.get(), request.type_.get(), request.for_dark_theme_, std::move(promise)); } -void Td::on_request(uint64 id, const td_api::removeBackground &request) { +void Td::on_request(uint64 id, const td_api::removeInstalledBackground &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); background_manager_->remove_background(BackgroundId(request.background_id_), std::move(promise)); } -void Td::on_request(uint64 id, const td_api::resetBackgrounds &request) { +void Td::on_request(uint64 id, const td_api::resetInstalledBackgrounds &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); background_manager_->reset_backgrounds(std::move(promise)); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 9cad51e74..f015e14ed 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -1591,17 +1591,17 @@ class Td final : public Actor { void on_request(uint64 id, const td_api::getSupportUser &request); - void on_request(uint64 id, const td_api::getBackgrounds &request); + void on_request(uint64 id, const td_api::getInstalledBackgrounds &request); void on_request(uint64 id, td_api::getBackgroundUrl &request); void on_request(uint64 id, td_api::searchBackground &request); - void on_request(uint64 id, td_api::setBackground &request); + void on_request(uint64 id, td_api::setDefaultBackground &request); - void on_request(uint64 id, const td_api::removeBackground &request); + void on_request(uint64 id, const td_api::removeInstalledBackground &request); - void on_request(uint64 id, const td_api::resetBackgrounds &request); + void on_request(uint64 id, const td_api::resetInstalledBackgrounds &request); void on_request(uint64 id, td_api::getRecentlyVisitedTMeUrls &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 8ec799f9c..38c17baab 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -3084,8 +3084,8 @@ class CliClient final : public Actor { send_request(td_api::make_object(website_id)); } else if (op == "daw") { send_request(td_api::make_object()); - } else if (op == "gbgs") { - send_request(td_api::make_object(as_bool(args))); + } else if (op == "gib") { + send_request(td_api::make_object(as_bool(args))); } else if (op == "gbgu") { send_get_background_url(as_wallpaper_background(false, false)); send_get_background_url(as_wallpaper_background(false, true)); @@ -3123,17 +3123,17 @@ class CliClient final : public Actor { if (op == "SBG") { send_request(td_api::make_object(args)); - } else if (op == "sbg" || op == "sbgd") { + } else if (op == "sdb" || op == "sdbd") { InputBackground input_background; BackgroundType background_type; get_args(args, input_background, background_type); - send_request(td_api::make_object(input_background, background_type, op == "sbgd")); - } else if (op == "rbg") { + send_request(td_api::make_object(input_background, background_type, op == "sdbd")); + } else if (op == "rib") { int64 background_id; get_args(args, background_id); - send_request(td_api::make_object(background_id)); - } else if (op == "rbgs") { - send_request(td_api::make_object()); + send_request(td_api::make_object(background_id)); + } else if (op == "ribs") { + send_request(td_api::make_object()); } else if (op == "scbg" || op == "scbgs") { ChatId chat_id; InputBackground input_background;