Add internalLinkTypeEditProfileSettings.

This commit is contained in:
levlam 2022-12-28 18:08:00 +03:00
parent 1a3789e88d
commit 630101358b
4 changed files with 23 additions and 5 deletions

View File

@ -4435,10 +4435,13 @@ internalLinkTypeChangePhoneNumber = 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;
//@description The link is a link to the default message auto-delete timer settings section of the app
//@description The link is a link to the default message auto-delete timer section of the app settings
internalLinkTypeDefaultMessageAutoDeleteTimerSettings = InternalLinkType;
//@description The link is a link to the filter settings section of the app
//@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 filter section of the app settings
internalLinkTypeFilterSettings = 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
@ -4455,7 +4458,7 @@ internalLinkTypeInvoice invoice_name:string = InternalLinkType;
//@description The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link @language_pack_id Language pack identifier
internalLinkTypeLanguagePack language_pack_id:string = InternalLinkType;
//@description The link is a link to the language settings section of the app
//@description The link is a link to the language section of the app settings
internalLinkTypeLanguageSettings = InternalLinkType;
//@description The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link @url URL to be passed to getMessageLinkInfo
@ -4482,7 +4485,7 @@ internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = Intern
//@description The link is a link to the Premium features screen of the applcation from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link @referrer Referrer specified in the link
internalLinkTypePremiumFeatures referrer:string = InternalLinkType;
//@description The link is a link to the privacy and security settings section of the app
//@description The link is a link to the privacy and security section of the app settings
internalLinkTypePrivacyAndSecuritySettings = InternalLinkType;
//@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy
@ -4512,7 +4515,7 @@ internalLinkTypeStickerSet sticker_set_name:string expect_custom_emoji:Bool = In
//@description The link is a link to a theme. TDLib has no theme support yet @theme_name Name of the theme
internalLinkTypeTheme theme_name:string = InternalLinkType;
//@description The link is a link to the theme settings section of the app
//@description The link is a link to the theme section of the app settings
internalLinkTypeThemeSettings = InternalLinkType;
//@description The link is an unknown tg: link. Call getDeepLinkInfo to process the link @link Link to be passed to getDeepLinkInfo

View File

@ -303,6 +303,12 @@ class LinkManager::InternalLinkDialogInvite final : public InternalLink {
}
};
class LinkManager::InternalLinkEditProfileSettings final : public InternalLink {
td_api::object_ptr<td_api::InternalLinkType> get_internal_link_type_object() const final {
return td_api::make_object<td_api::internalLinkTypeEditProfileSettings>();
}
};
class LinkManager::InternalLinkFilterSettings final : public InternalLink {
td_api::object_ptr<td_api::InternalLinkType> get_internal_link_type_object() const final {
return td_api::make_object<td_api::internalLinkTypeFilterSettings>();
@ -1140,6 +1146,10 @@ unique_ptr<LinkManager::InternalLink> LinkManager::parse_tg_link_query(Slice que
// settings/devices
return td::make_unique<InternalLinkActiveSessions>();
}
if (path.size() == 2 && path[1] == "edit_profile") {
// settings/edit_profile
return td::make_unique<InternalLinkEditProfileSettings>();
}
if (path.size() == 2 && path[1] == "folders") {
// settings/folders
return td::make_unique<InternalLinkFilterSettings>();

View File

@ -112,6 +112,7 @@ class LinkManager final : public Actor {
class InternalLinkConfirmPhone;
class InternalLinkDefaultMessageAutoDeleteTimerSettings;
class InternalLinkDialogInvite;
class InternalLinkEditProfileSettings;
class InternalLinkFilterSettings;
class InternalLinkGame;
class InternalLinkInstantView;

View File

@ -156,6 +156,9 @@ TEST(Link, parse_internal_link) {
auto default_message_auto_delete_timer_settings = [] {
return td::td_api::make_object<td::td_api::internalLinkTypeDefaultMessageAutoDeleteTimerSettings>();
};
auto edit_profile_settings = [] {
return td::td_api::make_object<td::td_api::internalLinkTypeEditProfileSettings>();
};
auto filter_settings = [] {
return td::td_api::make_object<td::td_api::internalLinkTypeFilterSettings>();
};
@ -972,6 +975,7 @@ TEST(Link, parse_internal_link) {
parse_internal_link("tg://settings/auto_delete", default_message_auto_delete_timer_settings());
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", filter_settings());
parse_internal_link("tg://settings/filters", settings());
parse_internal_link("tg://settings/language", language_settings());