Support updateNewScheduledMessage.

GitOrigin-RevId: 09e706ddb7eab36e139bc6619a92272dcaef1fa4
This commit is contained in:
levlam 2019-12-02 19:30:35 +03:00
parent bfd3d653a7
commit f34a515e70
3 changed files with 11 additions and 7 deletions

View File

@ -10782,6 +10782,9 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
sender_user_id = UserId(); sender_user_id = UserId();
} }
} }
if (message_id.is_scheduled()) {
is_channel_message = (dialog_type == DialogType::Channel);
}
int32 flags = message_info.flags; int32 flags = message_info.flags;
if (flags & if (flags &
@ -10801,8 +10804,8 @@ std::pair<DialogId, unique_ptr<MessagesManager::Message>> MessagesManager::creat
bool hide_edit_date = (flags & MESSAGE_FLAG_HIDE_EDIT_DATE) != 0; bool hide_edit_date = (flags & MESSAGE_FLAG_HIDE_EDIT_DATE) != 0;
bool is_from_scheduled = (flags & MESSAGE_FLAG_IS_FROM_SCHEDULED) != 0; bool is_from_scheduled = (flags & MESSAGE_FLAG_IS_FROM_SCHEDULED) != 0;
LOG_IF(ERROR, is_channel_message && dialog_type != DialogType::Channel) LOG_IF(ERROR, is_channel_message != (dialog_type == DialogType::Channel))
<< "is_channel_message is true for message received in the " << dialog_id; << "is_channel_message is wrong for message received in the " << dialog_id;
LOG_IF(ERROR, is_channel_post && !is_broadcast_channel(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; << "is_channel_post is true for message received in the " << dialog_id;

View File

@ -1912,6 +1912,11 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateMessagePoll> up
td_->poll_manager_->on_get_poll(PollId(update->poll_id_), std::move(update->poll_), std::move(update->results_)); 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<telegram_api::updateNewScheduledMessage> 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<telegram_api::updateDeleteScheduledMessages> update, void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateDeleteScheduledMessages> update,
bool /*force_apply*/) { bool /*force_apply*/) {
vector<ScheduledServerMessageId> message_ids = transform(update->messages_, [](int32 scheduled_server_message_id) { vector<ScheduledServerMessageId> message_ids = transform(update->messages_, [](int32 scheduled_server_message_id) {
@ -1923,9 +1928,6 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateDeleteScheduled
// unsupported updates // unsupported updates
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateNewScheduledMessage> update, bool /*force_apply*/) {
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateTheme> update, bool /*force_apply*/) { void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateTheme> update, bool /*force_apply*/) {
} }

View File

@ -280,12 +280,11 @@ class UpdatesManager : public Actor {
void on_update(tl_object_ptr<telegram_api::updateMessagePoll> update, bool /*force_apply*/); void on_update(tl_object_ptr<telegram_api::updateMessagePoll> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateNewScheduledMessage> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDeleteScheduledMessages> update, bool /*force_apply*/); void on_update(tl_object_ptr<telegram_api::updateDeleteScheduledMessages> update, bool /*force_apply*/);
// unsupported updates // unsupported updates
void on_update(tl_object_ptr<telegram_api::updateNewScheduledMessage> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateTheme> update, bool /*force_apply*/); void on_update(tl_object_ptr<telegram_api::updateTheme> update, bool /*force_apply*/);
}; };