2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Support replies to stories layout in messages.

This commit is contained in:
John Preston
2023-05-26 13:27:34 +04:00
parent b195ec4fd5
commit 2e6790c45c
15 changed files with 522 additions and 39 deletions

View File

@@ -2464,6 +2464,18 @@ Ui::ChatThemeBackgroundData SessionController::backgroundData(
};
}
void SessionController::openPeerStory(
not_null<PeerData*> peer,
StoryId storyId) {
using namespace Media::View;
using namespace Data;
auto &stories = session().data().stories();
if (const auto from = stories.lookup({ peer->id, storyId })) {
window().openInMediaView(OpenRequest(this, *from));
}
}
void SessionController::openPeerStories(PeerId peerId) {
using namespace Media::View;
using namespace Data;
@@ -2474,9 +2486,7 @@ void SessionController::openPeerStories(PeerId peerId) {
return list.user->id;
});
if (i != end(all) && !i->ids.empty()) {
if (const auto from = stories.lookup({ peerId, i->ids.front() })) {
window().openInMediaView(OpenRequest(this, *from));
}
openPeerStory(i->user, i->ids.front());
}
}

View File

@@ -564,6 +564,7 @@ public:
return _peerThemeOverride.value();
}
void openPeerStory(not_null<PeerData*> peer, StoryId storyId);
void openPeerStories(PeerId peerId);
struct PaintContextArgs {