2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 07:25:46 +00:00

Add short-polling of stories.

This commit is contained in:
John Preston
2023-07-05 19:52:22 +04:00
parent 12fe0a836a
commit 5ccb97668c
14 changed files with 308 additions and 52 deletions

View File

@@ -371,7 +371,12 @@ void Story::applyViewsSlice(
}
}
bool Story::applyChanges(StoryMedia media, const MTPDstoryItem &data) {
bool Story::applyChanges(
StoryMedia media,
const MTPDstoryItem &data,
TimeId now) {
_lastUpdateTime = now;
const auto pinned = data.is_pinned();
const auto edited = data.is_edited();
const auto isPublic = data.is_public();
@@ -424,6 +429,10 @@ bool Story::applyChanges(StoryMedia media, const MTPDstoryItem &data) {
return true;
}
TimeId Story::lastUpdateTime() const {
return _lastUpdateTime;
}
StoryPreload::StoryPreload(not_null<Story*> story, Fn<void()> done)
: _story(story)
, _done(std::move(done)) {