2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-06 01:16:12 +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

@@ -272,6 +272,38 @@ void Changes::entryRemoved(not_null<Dialogs::Entry*> entry) {
_entryChanges.drop(entry);
}
void Changes::storyUpdated(
not_null<Story*> story,
StoryUpdate::Flags flags) {
const auto drop = (flags & StoryUpdate::Flag::Destroyed);
_storyChanges.updated(story, flags, drop);
if (!drop) {
scheduleNotifications();
}
}
rpl::producer<StoryUpdate> Changes::storyUpdates(
StoryUpdate::Flags flags) const {
return _storyChanges.updates(flags);
}
rpl::producer<StoryUpdate> Changes::storyUpdates(
not_null<Story*> story,
StoryUpdate::Flags flags) const {
return _storyChanges.updates(story, flags);
}
rpl::producer<StoryUpdate> Changes::storyFlagsValue(
not_null<Story*> story,
StoryUpdate::Flags flags) const {
return _storyChanges.flagsValue(story, flags);
}
rpl::producer<StoryUpdate> Changes::realtimeStoryUpdates(
StoryUpdate::Flag flag) const {
return _storyChanges.realtimeUpdates(flag);
}
void Changes::scheduleNotifications() {
if (!_notify) {
_notify = true;
@@ -291,6 +323,7 @@ void Changes::sendNotifications() {
_messageChanges.sendNotifications();
_entryChanges.sendNotifications();
_topicChanges.sendNotifications();
_storyChanges.sendNotifications();
}
} // namespace Data