aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--td/generate/scheme/td_api.tl6
-rw-r--r--td/telegram/LinkManager.cpp6
-rw-r--r--test/link.cpp18
3 files changed, 15 insertions, 15 deletions
diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl
index 3d7a40be5..3ff111757 100644
--- a/td/generate/scheme/td_api.tl
+++ b/td/generate/scheme/td_api.tl
@@ -8620,6 +8620,9 @@ internalLinkTypeNewGroupChat = InternalLinkType;
//@description The link is a link to the screen for creating a new private chat with a contact
internalLinkTypeNewPrivateChat = InternalLinkType;
+//@description The link is a link to open the story posting interface @content_type The type of the content of the story to post; may be null if unspecified
+internalLinkTypeNewStory content_type:StoryContentType = InternalLinkType;
+
//@description The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it
//@bot_user_id User identifier of the service's bot; the corresponding user may be unknown yet
//@scope Telegram Passport element types requested by the service
@@ -8635,9 +8638,6 @@ internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:st
//@phone_number Phone number value from the link
internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType;
-//@description The link is a link to open the story posting interface @content_type The type of the content of the story to post; may be null if unspecified
-internalLinkTypePostStory content_type:StoryContentType = InternalLinkType;
-
//@description The link is a link to the Premium features screen of the application 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
internalLinkTypePremiumFeaturesPage referrer:string = InternalLinkType;
diff --git a/td/telegram/LinkManager.cpp b/td/telegram/LinkManager.cpp
index 1ec24d58d..d7b0346e1 100644
--- a/td/telegram/LinkManager.cpp
+++ b/td/telegram/LinkManager.cpp
@@ -993,7 +993,7 @@ class LinkManager::InternalLinkPostStory final : public InternalLink {
}
return nullptr;
}();
- return td_api::make_object<td_api::internalLinkTypePostStory>(std::move(content_type));
+ return td_api::make_object<td_api::internalLinkTypeNewStory>(std::move(content_type));
}
public:
@@ -3311,8 +3311,8 @@ Result<string> LinkManager::get_internal_link_impl(const td_api::InternalLinkTyp
<< "&hash=" << url_encode(link->hash_);
}
}
- case td_api::internalLinkTypePostStory::ID: {
- auto link = static_cast<const td_api::internalLinkTypePostStory *>(type_ptr);
+ case td_api::internalLinkTypeNewStory::ID: {
+ auto link = static_cast<const td_api::internalLinkTypeNewStory *>(type_ptr);
if (!is_internal) {
return Status::Error("HTTP link is unavailable for the link type");
}
diff --git a/test/link.cpp b/test/link.cpp
index b2e4c0080..85cc77ddf 100644
--- a/test/link.cpp
+++ b/test/link.cpp
@@ -421,6 +421,10 @@ static auto new_private_chat() {
return td::td_api::make_object<td::td_api::internalLinkTypeNewPrivateChat>();
}
+static auto new_story(td::td_api::object_ptr<td::td_api::StoryContentType> content_type) {
+ return td::td_api::make_object<td::td_api::internalLinkTypeNewStory>(std::move(content_type));
+}
+
static auto passport_data_request(td::int32 bot_user_id, const td::string &scope, const td::string &public_key,
const td::string &nonce, const td::string &callback_url) {
return td::td_api::make_object<td::td_api::internalLinkTypePassportDataRequest>(bot_user_id, scope, public_key, nonce,
@@ -431,10 +435,6 @@ static auto phone_number_confirmation(const td::string &hash, const td::string &
return td::td_api::make_object<td::td_api::internalLinkTypePhoneNumberConfirmation>(hash, phone_number);
}
-static auto post_story(td::td_api::object_ptr<td::td_api::StoryContentType> content_type) {
- return td::td_api::make_object<td::td_api::internalLinkTypePostStory>(std::move(content_type));
-}
-
static auto premium_features_page(const td::string &referrer) {
return td::td_api::make_object<td::td_api::internalLinkTypePremiumFeaturesPage>(referrer);
}
@@ -1020,12 +1020,12 @@ TEST(Link, parse_internal_link_part2) {
parse_internal_link("tg://new/channel", new_channel_chat());
parse_internal_link("tg://new/channel/", new_channel_chat());
- parse_internal_link("tg://post", post_story(nullptr));
- parse_internal_link("tg://post/photo", post_story(td::td_api::make_object<td::td_api::storyContentTypePhoto>()));
- parse_internal_link("tg://post/video", post_story(td::td_api::make_object<td::td_api::storyContentTypeVideo>()));
- parse_internal_link("tg://post/live", post_story(td::td_api::make_object<td::td_api::storyContentTypeLive>()));
+ parse_internal_link("tg://post", new_story(nullptr));
+ parse_internal_link("tg://post/photo", new_story(td::td_api::make_object<td::td_api::storyContentTypePhoto>()));
+ parse_internal_link("tg://post/video", new_story(td::td_api::make_object<td::td_api::storyContentTypeVideo>()));
+ parse_internal_link("tg://post/live", new_story(td::td_api::make_object<td::td_api::storyContentTypeLive>()));
parse_internal_link("tg://post/photos",
- post_story(td::td_api::make_object<td::td_api::storyContentTypeUnsupported>()));
+ new_story(td::td_api::make_object<td::td_api::storyContentTypeUnsupported>()));
parse_internal_link("t.me/joinchat?invite=abcdef", nullptr);
parse_internal_link("t.me/joinchat", nullptr);