From 3501529a95d1676df0d0b3140b2926ac7d6a795a Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 1 Jun 2023 18:25:59 +0300 Subject: [PATCH] Add updateStoryDeleted, --- td/generate/scheme/td_api.tl | 3 +++ td/telegram/StoryManager.cpp | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 5a3782094..b52b1d63b 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -5639,6 +5639,9 @@ updateUnreadChatCount chat_list:ChatList total_count:int32 unread_count:int32 un //@description A story was changed @story The new information about the story updateStory story:story = Update; +//@description A story became inaccessible @sender_user_id Identifier of the user that created the story @story_id Story identifier +updateStoryDeleted sender_user_id:int53 story_id:int32 = Update; + //@description An option changed its value @name The option name @value The new option value updateOption name:string value:OptionValue = Update; diff --git a/td/telegram/StoryManager.cpp b/td/telegram/StoryManager.cpp index f45b6bb69..af72ad1de 100644 --- a/td/telegram/StoryManager.cpp +++ b/td/telegram/StoryManager.cpp @@ -668,6 +668,13 @@ void StoryManager::on_delete_story(DialogId owner_dialog_id, StoryId story_id) { if (story == nullptr) { return; } + if (story->is_update_sent_) { + CHECK(owner_dialog_id.get_type() == DialogType::User); + send_closure(G()->td(), &Td::send_update, + td_api::make_object( + td_->contacts_manager_->get_user_id_object(owner_dialog_id.get_user_id(), "updateStoryDeleted"), + story_id.get())); + } delete_story_files(story); stories_.erase(story_full_id); }