Improve name of internalLinkTypeChatFolderSettings.

This commit is contained in:
levlam 2023-04-03 18:17:25 +03:00
parent c62bbfb583
commit d62f9281a7
4 changed files with 13 additions and 13 deletions

View File

@ -4656,6 +4656,9 @@ internalLinkTypeChangePhoneNumber = InternalLinkType;
//@description The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link
internalLinkTypeChatFolderInvite invite_link:string = InternalLinkType;
//@description The link is a link to the folder section of the app settings
internalLinkTypeChatFolderSettings = InternalLinkType;
//@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link
internalLinkTypeChatInvite invite_link:string = InternalLinkType;
@ -4665,9 +4668,6 @@ internalLinkTypeDefaultMessageAutoDeleteTimerSettings = InternalLinkType;
//@description The link is a link to the edit profile section of the app settings
internalLinkTypeEditProfileSettings = InternalLinkType;
//@description The link is a link to the folder section of the app settings
internalLinkTypeFolderSettings = InternalLinkType;
//@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame
//@bot_username Username of the bot that owns the game
//@game_short_name Short name of the game

View File

@ -396,9 +396,9 @@ class LinkManager::InternalLinkEditProfileSettings final : public InternalLink {
}
};
class LinkManager::InternalLinkFolderSettings final : public InternalLink {
class LinkManager::InternalLinkDialogFolderSettings final : public InternalLink {
td_api::object_ptr<td_api::InternalLinkType> get_internal_link_type_object() const final {
return td_api::make_object<td_api::internalLinkTypeFolderSettings>();
return td_api::make_object<td_api::internalLinkTypeChatFolderSettings>();
}
};
@ -1273,7 +1273,7 @@ unique_ptr<LinkManager::InternalLink> LinkManager::parse_tg_link_query(Slice que
}
if (path.size() == 2 && path[1] == "folders") {
// settings/folders
return td::make_unique<InternalLinkFolderSettings>();
return td::make_unique<InternalLinkDialogFolderSettings>();
}
if (path.size() == 2 && path[1] == "language") {
// settings/language
@ -1893,7 +1893,7 @@ Result<string> LinkManager::get_internal_link_impl(const td_api::InternalLinkTyp
return Status::Error("HTTP link is unavailable for the link type");
}
return "tg://settings/edit_profile";
case td_api::internalLinkTypeFolderSettings::ID:
case td_api::internalLinkTypeChatFolderSettings::ID:
if (!is_internal) {
return Status::Error("HTTP link is unavailable for the link type");
}

View File

@ -125,9 +125,9 @@ class LinkManager final : public Actor {
class InternalLinkConfirmPhone;
class InternalLinkDefaultMessageAutoDeleteTimerSettings;
class InternalLinkDialogFolderInvite;
class InternalLinkDialogFolderSettings;
class InternalLinkDialogInvite;
class InternalLinkEditProfileSettings;
class InternalLinkFolderSettings;
class InternalLinkGame;
class InternalLinkInstantView;
class InternalLinkInvoice;

View File

@ -222,6 +222,10 @@ static auto chat_folder_invite(const td::string &slug) {
return td::td_api::make_object<td::td_api::internalLinkTypeChatFolderInvite>("tg:list?slug=" + slug);
}
static auto chat_folder_settings() {
return td::td_api::make_object<td::td_api::internalLinkTypeChatFolderSettings>();
}
static auto chat_invite(const td::string &hash) {
return td::td_api::make_object<td::td_api::internalLinkTypeChatInvite>("tg:join?invite=" + hash);
}
@ -234,10 +238,6 @@ static auto edit_profile_settings() {
return td::td_api::make_object<td::td_api::internalLinkTypeEditProfileSettings>();
}
static auto folder_settings() {
return td::td_api::make_object<td::td_api::internalLinkTypeFolderSettings>();
}
static auto game(const td::string &bot_username, const td::string &game_short_name) {
return td::td_api::make_object<td::td_api::internalLinkTypeGame>(bot_username, game_short_name);
}
@ -1145,7 +1145,7 @@ TEST(Link, parse_internal_link_part4) {
parse_internal_link("tg://settings/devices", active_sessions());
parse_internal_link("tg://settings/change_number", change_phone_number());
parse_internal_link("tg://settings/edit_profile", edit_profile_settings());
parse_internal_link("tg://settings/folders", folder_settings());
parse_internal_link("tg://settings/folders", chat_folder_settings());
parse_internal_link("tg://settings/filters", settings());
parse_internal_link("tg://settings/language", language_settings());
parse_internal_link("tg://settings/privacy", privacy_and_security_settings());