mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Open stories by t.me/username?story=id links.
This commit is contained in:
parent
a933168ef7
commit
d7186e68e2
3 changed files with 15 additions and 0 deletions
|
@ -383,6 +383,7 @@ bool ResolveUsernameOrPhone(
|
||||||
if (const auto postId = postParam.toInt()) {
|
if (const auto postId = postParam.toInt()) {
|
||||||
post = postId;
|
post = postId;
|
||||||
}
|
}
|
||||||
|
const auto storyId = params.value(u"story"_q).toInt();
|
||||||
const auto appname = params.value(u"appname"_q);
|
const auto appname = params.value(u"appname"_q);
|
||||||
const auto appstart = params.value(u"startapp"_q);
|
const auto appstart = params.value(u"startapp"_q);
|
||||||
const auto commentParam = params.value(u"comment"_q);
|
const auto commentParam = params.value(u"comment"_q);
|
||||||
|
@ -408,6 +409,7 @@ bool ResolveUsernameOrPhone(
|
||||||
.usernameOrId = domain,
|
.usernameOrId = domain,
|
||||||
.phone = phone,
|
.phone = phone,
|
||||||
.messageId = post,
|
.messageId = post,
|
||||||
|
.storyId = storyId,
|
||||||
.repliesInfo = commentId
|
.repliesInfo = commentId
|
||||||
? Navigation::RepliesByLinkInfo{
|
? Navigation::RepliesByLinkInfo{
|
||||||
Navigation::CommentId{ commentId }
|
Navigation::CommentId{ commentId }
|
||||||
|
|
|
@ -503,6 +503,18 @@ void SessionNavigation::showPeerByLinkResolved(
|
||||||
info.messageId,
|
info.messageId,
|
||||||
callback);
|
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) {
|
} else if (bot && resolveType == ResolveType::BotApp) {
|
||||||
const auto itemId = info.clickFromMessageId;
|
const auto itemId = info.clickFromMessageId;
|
||||||
const auto item = _session->data().message(itemId);
|
const auto item = _session->data().message(itemId);
|
||||||
|
|
|
@ -204,6 +204,7 @@ public:
|
||||||
std::variant<QString, ChannelId> usernameOrId;
|
std::variant<QString, ChannelId> usernameOrId;
|
||||||
QString phone;
|
QString phone;
|
||||||
MsgId messageId = ShowAtUnreadMsgId;
|
MsgId messageId = ShowAtUnreadMsgId;
|
||||||
|
StoryId storyId = 0;
|
||||||
RepliesByLinkInfo repliesInfo;
|
RepliesByLinkInfo repliesInfo;
|
||||||
ResolveType resolveType = ResolveType::Default;
|
ResolveType resolveType = ResolveType::Default;
|
||||||
QString startToken;
|
QString startToken;
|
||||||
|
|
Loading…
Add table
Reference in a new issue