From 630101358bf2929bc957e5f5942d84220280d7e9 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 28 Dec 2022 18:08:00 +0300 Subject: [PATCH] Add internalLinkTypeEditProfileSettings. --- td/generate/scheme/td_api.tl | 13 ++++++++----- td/telegram/LinkManager.cpp | 10 ++++++++++ td/telegram/LinkManager.h | 1 + test/link.cpp | 4 ++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index dee837b27..d52ea69f1 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -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 diff --git a/td/telegram/LinkManager.cpp b/td/telegram/LinkManager.cpp index 5bc4faa42..3911df434 100644 --- a/td/telegram/LinkManager.cpp +++ b/td/telegram/LinkManager.cpp @@ -303,6 +303,12 @@ class LinkManager::InternalLinkDialogInvite final : public InternalLink { } }; +class LinkManager::InternalLinkEditProfileSettings final : public InternalLink { + td_api::object_ptr get_internal_link_type_object() const final { + return td_api::make_object(); + } +}; + class LinkManager::InternalLinkFilterSettings final : public InternalLink { td_api::object_ptr get_internal_link_type_object() const final { return td_api::make_object(); @@ -1140,6 +1146,10 @@ unique_ptr LinkManager::parse_tg_link_query(Slice que // settings/devices return td::make_unique(); } + if (path.size() == 2 && path[1] == "edit_profile") { + // settings/edit_profile + return td::make_unique(); + } if (path.size() == 2 && path[1] == "folders") { // settings/folders return td::make_unique(); diff --git a/td/telegram/LinkManager.h b/td/telegram/LinkManager.h index 3113ade6f..c13406728 100644 --- a/td/telegram/LinkManager.h +++ b/td/telegram/LinkManager.h @@ -112,6 +112,7 @@ class LinkManager final : public Actor { class InternalLinkConfirmPhone; class InternalLinkDefaultMessageAutoDeleteTimerSettings; class InternalLinkDialogInvite; + class InternalLinkEditProfileSettings; class InternalLinkFilterSettings; class InternalLinkGame; class InternalLinkInstantView; diff --git a/test/link.cpp b/test/link.cpp index 7d4ca29c4..540884211 100644 --- a/test/link.cpp +++ b/test/link.cpp @@ -156,6 +156,9 @@ TEST(Link, parse_internal_link) { auto default_message_auto_delete_timer_settings = [] { return td::td_api::make_object(); }; + auto edit_profile_settings = [] { + return td::td_api::make_object(); + }; auto filter_settings = [] { return td::td_api::make_object(); }; @@ -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());