Return active stories from cache.

This commit is contained in:
levlam 2023-06-19 19:55:30 +03:00
parent 917b4dc1b6
commit 63495795c5

View File

@ -788,6 +788,12 @@ void StoryManager::get_dialog_expiring_stories(DialogId owner_dialog_id,
return promise.set_value(td_api::make_object<td_api::activeStories>(owner_dialog_id.get(), 0, Auto())); return promise.set_value(td_api::make_object<td_api::activeStories>(owner_dialog_id.get(), 0, Auto()));
} }
auto active_stories = get_active_stories(owner_dialog_id);
if (active_stories != nullptr && promise) {
promise.set_value(get_active_stories_object(owner_dialog_id));
promise = {};
}
auto query_promise = auto query_promise =
PromiseCreator::lambda([actor_id = actor_id(this), owner_dialog_id, promise = std::move(promise)]( PromiseCreator::lambda([actor_id = actor_id(this), owner_dialog_id, promise = std::move(promise)](
Result<telegram_api::object_ptr<telegram_api::stories_userStories>> &&result) mutable { Result<telegram_api::object_ptr<telegram_api::stories_userStories>> &&result) mutable {