diff --git a/Telegram/SourceFiles/core/local_url_handlers.cpp b/Telegram/SourceFiles/core/local_url_handlers.cpp index 58c7af3a61..6fa9d7bb64 100644 --- a/Telegram/SourceFiles/core/local_url_handlers.cpp +++ b/Telegram/SourceFiles/core/local_url_handlers.cpp @@ -563,6 +563,7 @@ bool ResolveUsernameOrPhone( .phone = phone, .messageId = post, .storyId = storyId, + .text = params.value(u"text"_q), .repliesInfo = commentId ? Window::RepliesByLinkInfo{ Window::CommentId{ commentId } diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index 86a5f53c1f..47cf5326c3 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -702,7 +702,11 @@ void SessionNavigation::showPeerByLinkResolved( contextUser->owner().history(contextUser)) : std::optional())); } else { + const auto draft = info.text; crl::on_main(this, [=] { + if (peer->isUser() && !draft.isEmpty()) { + Data::SetChatLinkDraft(peer, { draft }); + } showPeerHistory(peer, params, msgId); }); } diff --git a/Telegram/SourceFiles/window/window_session_controller_link_info.h b/Telegram/SourceFiles/window/window_session_controller_link_info.h index 01224a3f0f..2c74571228 100644 --- a/Telegram/SourceFiles/window/window_session_controller_link_info.h +++ b/Telegram/SourceFiles/window/window_session_controller_link_info.h @@ -34,6 +34,7 @@ struct PeerByLinkInfo { QString chatLinkSlug; MsgId messageId = ShowAtUnreadMsgId; StoryId storyId = 0; + QString text; RepliesByLinkInfo repliesInfo; ResolveType resolveType = ResolveType::Default; QString startToken;