2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Open stories by t.me/username?story=id links.

This commit is contained in:
John Preston
2023-06-12 21:06:28 +04:00
parent a933168ef7
commit d7186e68e2
3 changed files with 15 additions and 0 deletions

View File

@@ -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);