Support updateReadStories.
This commit is contained in:
parent
e89cc266a0
commit
56df91b265
@ -1233,6 +1233,14 @@ void StoryManager::send_update_active_stories(DialogId owner_dialog_id) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void StoryManager::on_update_read_stories(DialogId owner_dialog_id, StoryId max_read_story_id) {
|
||||
auto active_stories = active_stories_.get_pointer(owner_dialog_id);
|
||||
if (active_stories != nullptr && max_read_story_id.get() > active_stories->max_read_story_id_.get()) {
|
||||
auto story_ids = active_stories->story_ids_;
|
||||
on_update_active_stories(owner_dialog_id, max_read_story_id, std::move(story_ids));
|
||||
}
|
||||
}
|
||||
|
||||
FileSourceId StoryManager::get_story_file_source_id(StoryFullId story_full_id) {
|
||||
if (td_->auth_manager_->is_bot()) {
|
||||
return FileSourceId();
|
||||
|
@ -122,6 +122,8 @@ class StoryManager final : public Actor {
|
||||
std::pair<int32, vector<StoryId>> on_get_stories(DialogId owner_dialog_id, vector<int32> &&expected_story_ids,
|
||||
telegram_api::object_ptr<telegram_api::stories_stories> &&stories);
|
||||
|
||||
void on_update_read_stories(DialogId owner_dialog_id, StoryId max_read_story_id);
|
||||
|
||||
bool have_story(StoryFullId story_full_id) const;
|
||||
|
||||
bool have_story_force(StoryFullId story_full_id) const;
|
||||
|
@ -4209,12 +4209,13 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateStory> update,
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
// unsupported updates
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateReadStories> update, Promise<Unit> &&promise) {
|
||||
td_->story_manager_->on_update_read_stories(DialogId(UserId(update->user_id_)), StoryId(update->max_id_));
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
// unsupported updates
|
||||
|
||||
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateStoryID> update, Promise<Unit> &&promise) {
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
@ -615,10 +615,10 @@ class UpdatesManager final : public Actor {
|
||||
|
||||
void on_update(tl_object_ptr<telegram_api::updateStory> update, Promise<Unit> &&promise);
|
||||
|
||||
// unsupported updates
|
||||
|
||||
void on_update(tl_object_ptr<telegram_api::updateReadStories> update, Promise<Unit> &&promise);
|
||||
|
||||
// unsupported updates
|
||||
|
||||
void on_update(tl_object_ptr<telegram_api::updateStoryID> update, Promise<Unit> &&promise);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user