diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index ec2b3f63d..c515c6dae 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -6762,10 +6762,14 @@ bool MessagesManager::need_skip_bot_commands(DialogId dialog_id, const Message * td_->dialog_manager_->is_broadcast_channel(dialog_id); } -void MessagesManager::on_external_update_message_content(MessageFullId message_full_id, const char *source) { +void MessagesManager::on_external_update_message_content(MessageFullId message_full_id, const char *source, + bool expect_no_message) { Dialog *d = get_dialog(message_full_id.get_dialog_id()); CHECK(d != nullptr); Message *m = get_message(d, message_full_id.get_message_id()); + if (expect_no_message && m == nullptr) { + return; + } CHECK(m != nullptr); send_update_message_content(d, m, true, source); // must not call on_message_changed, because the message itself wasn't changed diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 634b0fe49..15daebd50 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -343,7 +343,8 @@ class MessagesManager final : public Actor { void on_update_message_extended_media(MessageFullId message_full_id, telegram_api::object_ptr extended_media); - void on_external_update_message_content(MessageFullId message_full_id, const char *source); + void on_external_update_message_content(MessageFullId message_full_id, const char *source, + bool expect_no_message = false); void on_update_message_content(MessageFullId message_full_id); diff --git a/td/telegram/StoryManager.cpp b/td/telegram/StoryManager.cpp index ea5fe2562..e378bbb28 100644 --- a/td/telegram/StoryManager.cpp +++ b/td/telegram/StoryManager.cpp @@ -3810,7 +3810,7 @@ void StoryManager::on_story_changed(StoryFullId story_full_id, const Story *stor CHECK(!message_full_ids.empty()); for (const auto &message_full_id : message_full_ids) { send_closure_later(G()->messages_manager(), &MessagesManager::on_external_update_message_content, - message_full_id, "on_story_changed"); + message_full_id, "on_story_changed", true); } } }