diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 1e6cda40fb..2d013e6120 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -383,6 +383,7 @@ bool ResolveUsernameOrPhone( if (const auto postId = postParam.toInt()) { post = postId; } + const auto storyId = params.value(u"story"_q).toInt(); const auto appname = params.value(u"appname"_q); const auto appstart = params.value(u"startapp"_q); const auto commentParam = params.value(u"comment"_q); @@ -408,6 +409,7 @@ bool ResolveUsernameOrPhone( .usernameOrId = domain, .phone = phone, .messageId = post, + .storyId = storyId, .repliesInfo = commentId ? Navigation::RepliesByLinkInfo{ Navigation::CommentId{ commentId } diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index d6214affc8..0e3277348b 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -503,6 +503,18 @@ void SessionNavigation::showPeerByLinkResolved( info.messageId, callback); } + } else if (peer->isUser() && info.storyId) { + const auto storyId = FullStoryId{ peer->id, info.storyId }; + peer->owner().stories().resolve(storyId, crl::guard(this, [=] { + if (peer->owner().stories().lookup(storyId)) { + parentController()->openPeerStory( + peer, + storyId.story, + Data::StoriesContext{ Data::StoriesContextSingle() }); + } else { + showToast(tr::lng_confirm_phone_link_invalid(tr::now)); + } + })); } else if (bot && resolveType == ResolveType::BotApp) { const auto itemId = info.clickFromMessageId; const auto item = _session->data().message(itemId); diff --git a/Telegram/SourceFiles/window/window_session_controller.h b/Telegram/SourceFiles/window/window_session_controller.h index f92f7d98fe..1fb50ac2aa 100644 --- a/Telegram/SourceFiles/window/window_session_controller.h +++ b/Telegram/SourceFiles/window/window_session_controller.h @@ -204,6 +204,7 @@ public: std::variant usernameOrId; QString phone; MsgId messageId = ShowAtUnreadMsgId; + StoryId storyId = 0; RepliesByLinkInfo repliesInfo; ResolveType resolveType = ResolveType::Default; QString startToken;