diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 05510536e..f457ab397 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -10782,6 +10782,9 @@ std::pair> MessagesManager::creat sender_user_id = UserId(); } } + if (message_id.is_scheduled()) { + is_channel_message = (dialog_type == DialogType::Channel); + } int32 flags = message_info.flags; if (flags & @@ -10801,8 +10804,8 @@ std::pair> MessagesManager::creat bool hide_edit_date = (flags & MESSAGE_FLAG_HIDE_EDIT_DATE) != 0; bool is_from_scheduled = (flags & MESSAGE_FLAG_IS_FROM_SCHEDULED) != 0; - LOG_IF(ERROR, is_channel_message && dialog_type != DialogType::Channel) - << "is_channel_message is true for message received in the " << dialog_id; + LOG_IF(ERROR, is_channel_message != (dialog_type == DialogType::Channel)) + << "is_channel_message is wrong for message received in the " << dialog_id; LOG_IF(ERROR, is_channel_post && !is_broadcast_channel(dialog_id)) << "is_channel_post is true for message received in the " << dialog_id; diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 88b583566..3b15d2ddf 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -1912,6 +1912,11 @@ void UpdatesManager::on_update(tl_object_ptr up td_->poll_manager_->on_get_poll(PollId(update->poll_id_), std::move(update->poll_), std::move(update->results_)); } +void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { + td_->messages_manager_->on_get_message(std::move(update->message_), true, false, true, true, true, + "updateNewScheduledMessage"); +} + void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { vector message_ids = transform(update->messages_, [](int32 scheduled_server_message_id) { @@ -1923,9 +1928,6 @@ void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { -} - void UpdatesManager::on_update(tl_object_ptr update, bool /*force_apply*/) { } diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index 2293c8841..65291a621 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -280,12 +280,11 @@ class UpdatesManager : public Actor { void on_update(tl_object_ptr update, bool /*force_apply*/); + void on_update(tl_object_ptr update, bool /*force_apply*/); void on_update(tl_object_ptr update, bool /*force_apply*/); // unsupported updates - void on_update(tl_object_ptr update, bool /*force_apply*/); - void on_update(tl_object_ptr update, bool /*force_apply*/); };