2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +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

@@ -10,10 +10,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/timer.h"
#include "base/power_save_blocker.h"
#include "chat_helpers/compose/compose_show.h"
#include "data/data_changes.h"
#include "data/data_file_origin.h"
#include "data/data_session.h"
#include "data/data_stories.h"
#include "data/data_user.h"
#include "main/main_session.h"
#include "media/stories/media_stories_caption_full_view.h"
#include "media/stories/media_stories_delegate.h"
#include "media/stories/media_stories_header.h"
@@ -394,6 +396,18 @@ void Controller::show(
_slider->show({ .index = _index, .total = list.total });
_replyArea->show({ .user = list.user, .id = id });
const auto session = &list.user->session();
if (_session != session) {
_session = session;
_sessionLifetime = session->changes().storyUpdates(
Data::StoryUpdate::Flag::Destroyed
) | rpl::start_with_next([=](Data::StoryUpdate update) {
if (update.story->fullId() == _shown) {
_delegate->storiesClose();
}
});
}
if (_contentFaded) {
togglePaused(true);
}