Send updateChatActiveStories when deleting non-loaded story.

This commit is contained in:
levlam 2023-08-16 16:42:24 +03:00
parent 89b2a51d2d
commit 11f4af48e0

View File

@ -3084,13 +3084,10 @@ void StoryManager::on_delete_story(StoryFullId story_full_id) {
send_closure_later(G()->messages_manager(), send_closure_later(G()->messages_manager(),
&MessagesManager::update_story_max_reply_media_timestamp_in_replied_messages, story_full_id); &MessagesManager::update_story_max_reply_media_timestamp_in_replied_messages, story_full_id);
LOG(INFO) << "Delete " << story_full_id;
const Story *story = get_story_force(story_full_id, "on_delete_story"); const Story *story = get_story_force(story_full_id, "on_delete_story");
if (story == nullptr) {
delete_story_from_database(story_full_id);
return;
}
auto owner_dialog_id = story_full_id.get_dialog_id(); auto owner_dialog_id = story_full_id.get_dialog_id();
if (story != nullptr) {
LOG(INFO) << "Delete " << story_full_id;
if (story->is_update_sent_) { if (story->is_update_sent_) {
send_closure( send_closure(
G()->td(), &Td::send_update, G()->td(), &Td::send_update,
@ -3110,6 +3107,9 @@ void StoryManager::on_delete_story(StoryFullId story_full_id) {
being_edited_stories_.erase(edited_stories_it); being_edited_stories_.erase(edited_stories_it);
} }
edit_generations_.erase(story_full_id); edit_generations_.erase(story_full_id);
} else {
LOG(INFO) << "Delete not found " << story_full_id;
}
auto active_stories = get_active_stories_force(owner_dialog_id, "on_get_deleted_story"); auto active_stories = get_active_stories_force(owner_dialog_id, "on_get_deleted_story");
if (active_stories != nullptr && contains(active_stories->story_ids_, story_id)) { if (active_stories != nullptr && contains(active_stories->story_ids_, story_id)) {