Split opened stories by chats in StoryManager::update_interaction_info.
This commit is contained in:
parent
83d9f84c5b
commit
d029d93f85
@ -2371,16 +2371,18 @@ void StoryManager::update_interaction_info() {
|
|||||||
if (opened_owned_stories_.empty()) {
|
if (opened_owned_stories_.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
vector<StoryId> story_ids;
|
FlatHashMap<DialogId, vector<StoryId>, DialogIdHash> splitted_story_ids;
|
||||||
for (auto &it : opened_owned_stories_) {
|
for (auto &it : opened_owned_stories_) {
|
||||||
auto story_full_id = it.first;
|
auto story_full_id = it.first;
|
||||||
CHECK(story_full_id.get_dialog_id() == DialogId(td_->contacts_manager_->get_my_id()));
|
auto &story_ids = splitted_story_ids[story_full_id.get_dialog_id()];
|
||||||
story_ids.push_back(story_full_id.get_story_id());
|
if (story_ids.size() < 100) {
|
||||||
if (story_ids.size() >= 100) {
|
story_ids.push_back(story_full_id.get_story_id());
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
td_->create_handler<GetStoriesViewsQuery>()->send(std::move(story_ids));
|
for (auto &story_ids : splitted_story_ids) {
|
||||||
|
CHECK(story_ids.first == DialogId(td_->contacts_manager_->get_my_id()));
|
||||||
|
td_->create_handler<GetStoriesViewsQuery>()->send(std::move(story_ids.second));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StoryManager::increment_story_views(DialogId owner_dialog_id, PendingStoryViews &story_views) {
|
void StoryManager::increment_story_views(DialogId owner_dialog_id, PendingStoryViews &story_views) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user