mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Fix startchannel/startgroup deeplinks for bots with Threaded Mode.
Move the isForum() branch below bot-specific handlers (BotApp, ShareGame, AddToGroup/AddToChannel) so forum view doesn't intercept bot deeplinks. Move Boost branch above isForum() to simplify the condition.
This commit is contained in:
@@ -675,22 +675,6 @@ void SessionNavigation::showPeerByLinkResolved(
|
|||||||
showPeerInfo(peer, params);
|
showPeerInfo(peer, params);
|
||||||
} else if (resolveType == ResolveType::HashtagSearch) {
|
} else if (resolveType == ResolveType::HashtagSearch) {
|
||||||
searchMessages(info.text, peer->owner().history(peer));
|
searchMessages(info.text, peer->owner().history(peer));
|
||||||
} else if (peer->isForum() && resolveType != ResolveType::Boost) {
|
|
||||||
if (!msgId || !useRequestedMessageId) {
|
|
||||||
applyBotStartToken();
|
|
||||||
parentController()->showForum(peer->forum(), params, msgId);
|
|
||||||
} else if (const auto item = peer->owner().message(peer, msgId)) {
|
|
||||||
showMessageByLinkResolved(item, info);
|
|
||||||
} else {
|
|
||||||
const auto callback = crl::guard(this, [=] {
|
|
||||||
if (const auto item = peer->owner().message(peer, msgId)) {
|
|
||||||
showMessageByLinkResolved(item, info);
|
|
||||||
} else {
|
|
||||||
showPeerHistory(peer, params, msgId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
peer->session().api().requestMessageData(peer, msgId, callback);
|
|
||||||
}
|
|
||||||
} else if (info.storyParam == u"live"_q) {
|
} else if (info.storyParam == u"live"_q) {
|
||||||
parentController()->openPeerStories(peer->id, std::nullopt, true);
|
parentController()->openPeerStories(peer->id, std::nullopt, true);
|
||||||
} else if (const auto storyId = info.storyParam.toInt()) {
|
} else if (const auto storyId = info.storyParam.toInt()) {
|
||||||
@@ -754,6 +738,24 @@ void SessionNavigation::showPeerByLinkResolved(
|
|||||||
scope,
|
scope,
|
||||||
info.startToken,
|
info.startToken,
|
||||||
info.startAdminRights);
|
info.startAdminRights);
|
||||||
|
} else if (resolveType == ResolveType::Boost && peer->isChannel()) {
|
||||||
|
resolveBoostState(peer->asChannel());
|
||||||
|
} else if (peer->isForum()) {
|
||||||
|
if (!msgId || !useRequestedMessageId) {
|
||||||
|
applyBotStartToken();
|
||||||
|
parentController()->showForum(peer->forum(), params, msgId);
|
||||||
|
} else if (const auto item = peer->owner().message(peer, msgId)) {
|
||||||
|
showMessageByLinkResolved(item, info);
|
||||||
|
} else {
|
||||||
|
const auto callback = crl::guard(this, [=] {
|
||||||
|
if (const auto item = peer->owner().message(peer, msgId)) {
|
||||||
|
showMessageByLinkResolved(item, info);
|
||||||
|
} else {
|
||||||
|
showPeerHistory(peer, params, msgId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
peer->session().api().requestMessageData(peer, msgId, callback);
|
||||||
|
}
|
||||||
} else if (resolveType == ResolveType::Mention) {
|
} else if (resolveType == ResolveType::Mention) {
|
||||||
if (bot || peer->isChannel()) {
|
if (bot || peer->isChannel()) {
|
||||||
crl::on_main(this, [=] {
|
crl::on_main(this, [=] {
|
||||||
@@ -762,8 +764,6 @@ void SessionNavigation::showPeerByLinkResolved(
|
|||||||
} else {
|
} else {
|
||||||
showPeerInfo(peer, params);
|
showPeerInfo(peer, params);
|
||||||
}
|
}
|
||||||
} else if (resolveType == ResolveType::Boost && peer->isChannel()) {
|
|
||||||
resolveBoostState(peer->asChannel());
|
|
||||||
} else if (resolveType == ResolveType::ChannelDirect
|
} else if (resolveType == ResolveType::ChannelDirect
|
||||||
&& !peer->isFullLoaded()) {
|
&& !peer->isFullLoaded()) {
|
||||||
_waitingDirectChannel = peer;
|
_waitingDirectChannel = peer;
|
||||||
|
|||||||
Reference in New Issue
Block a user