Support t.me/username?text=.. links.
This commit is contained in:
parent
170ebb57c6
commit
a506b8b25c
|
@ -563,6 +563,7 @@ bool ResolveUsernameOrPhone(
|
||||||
.phone = phone,
|
.phone = phone,
|
||||||
.messageId = post,
|
.messageId = post,
|
||||||
.storyId = storyId,
|
.storyId = storyId,
|
||||||
|
.text = params.value(u"text"_q),
|
||||||
.repliesInfo = commentId
|
.repliesInfo = commentId
|
||||||
? Window::RepliesByLinkInfo{
|
? Window::RepliesByLinkInfo{
|
||||||
Window::CommentId{ commentId }
|
Window::CommentId{ commentId }
|
||||||
|
|
|
@ -702,7 +702,11 @@ void SessionNavigation::showPeerByLinkResolved(
|
||||||
contextUser->owner().history(contextUser))
|
contextUser->owner().history(contextUser))
|
||||||
: std::optional<Api::SendAction>()));
|
: std::optional<Api::SendAction>()));
|
||||||
} else {
|
} else {
|
||||||
|
const auto draft = info.text;
|
||||||
crl::on_main(this, [=] {
|
crl::on_main(this, [=] {
|
||||||
|
if (peer->isUser() && !draft.isEmpty()) {
|
||||||
|
Data::SetChatLinkDraft(peer, { draft });
|
||||||
|
}
|
||||||
showPeerHistory(peer, params, msgId);
|
showPeerHistory(peer, params, msgId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ struct PeerByLinkInfo {
|
||||||
QString chatLinkSlug;
|
QString chatLinkSlug;
|
||||||
MsgId messageId = ShowAtUnreadMsgId;
|
MsgId messageId = ShowAtUnreadMsgId;
|
||||||
StoryId storyId = 0;
|
StoryId storyId = 0;
|
||||||
|
QString text;
|
||||||
RepliesByLinkInfo repliesInfo;
|
RepliesByLinkInfo repliesInfo;
|
||||||
ResolveType resolveType = ResolveType::Default;
|
ResolveType resolveType = ResolveType::Default;
|
||||||
QString startToken;
|
QString startToken;
|
||||||
|
|
Loading…
Reference in New Issue