Improve names of background-related methods.

This commit is contained in:
levlam 2023-12-19 14:33:21 +03:00
parent 325f56dfe0
commit 0fc3b3adc6
4 changed files with 26 additions and 26 deletions

View File

@ -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

View File

@ -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));

View File

@ -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);

View File

@ -3084,8 +3084,8 @@ class CliClient final : public Actor {
send_request(td_api::make_object<td_api::disconnectWebsite>(website_id));
} else if (op == "daw") {
send_request(td_api::make_object<td_api::disconnectAllWebsites>());
} else if (op == "gbgs") {
send_request(td_api::make_object<td_api::getBackgrounds>(as_bool(args)));
} else if (op == "gib") {
send_request(td_api::make_object<td_api::getInstalledBackgrounds>(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<td_api::searchBackground>(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<td_api::setBackground>(input_background, background_type, op == "sbgd"));
} else if (op == "rbg") {
send_request(td_api::make_object<td_api::setDefaultBackground>(input_background, background_type, op == "sdbd"));
} else if (op == "rib") {
int64 background_id;
get_args(args, background_id);
send_request(td_api::make_object<td_api::removeBackground>(background_id));
} else if (op == "rbgs") {
send_request(td_api::make_object<td_api::resetBackgrounds>());
send_request(td_api::make_object<td_api::removeInstalledBackground>(background_id));
} else if (op == "ribs") {
send_request(td_api::make_object<td_api::resetInstalledBackgrounds>());
} else if (op == "scbg" || op == "scbgs") {
ChatId chat_id;
InputBackground input_background;