2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-10-27 15:07:24 +00:00

Added ability to open single typed shared media in window for topics.

This commit is contained in:
23rd
2025-01-30 12:04:44 +03:00
parent 0089cad740
commit 7442ea7a16
4 changed files with 44 additions and 14 deletions

View File

@@ -1207,8 +1207,18 @@ void SessionNavigation::showByInitialId(
: (id.sharedMedia == SeparateSharedMediaType::GIF)
? Storage::SharedMediaType::GIF
: Storage::SharedMediaType::Photo;
const auto topicRootId = id.sharedMediaTopicRootId();
const auto peer = id.sharedMediaPeer();
const auto topic = topicRootId
? peer->forumTopicFor(topicRootId)
: nullptr;
if (topicRootId && !topic) {
break;
}
showSection(
std::make_shared<Info::Memento>(id.sharedMediaPeer(), type),
topicRootId
? std::make_shared<Info::Memento>(topic, type)
: std::make_shared<Info::Memento>(peer, type),
instant);
parent->widget()->setMaximumWidth(st::maxWidthSharedMediaWindow);
break;