From 24e2dcd590009bc8e5e64daadd6c468baaff0b94 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 26 Feb 2020 16:26:25 +0300 Subject: [PATCH] Reregister edited scheduled messages. GitOrigin-RevId: 72d2f5804fb6fb7dc5e4fb026dd1ef6640ee63f6 --- td/telegram/MessagesManager.cpp | 6 +----- td/telegram/PollManager.cpp | 4 ++-- td/telegram/WebPagesManager.cpp | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index b2b27579..d129de8c 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -27281,7 +27281,7 @@ bool MessagesManager::update_message(Dialog *d, Message *old_message, unique_ptr if (update_message_content(dialog_id, old_message, std::move(new_message->content), true, message_id.is_yet_unsent() && new_message->edit_date == 0, - !is_scheduled && get_message(d, message_id) != nullptr)) { + get_message(d, message_id) != nullptr)) { need_send_update = true; } @@ -27311,10 +27311,6 @@ bool MessagesManager::update_message_content(DialogId dialog_id, Message *old_me unique_ptr new_content, bool need_send_update_message_content, bool need_merge_files, bool is_message_in_dialog) { - if (old_message->message_id.is_scheduled()) { - is_message_in_dialog = false; - } - bool is_content_changed = false; bool need_update = false; unique_ptr &old_content = old_message->content; diff --git a/td/telegram/PollManager.cpp b/td/telegram/PollManager.cpp index 1982bb7a..93d13650 100644 --- a/td/telegram/PollManager.cpp +++ b/td/telegram/PollManager.cpp @@ -580,7 +580,7 @@ void PollManager::register_poll(PollId poll_id, FullMessageId full_message_id, c } LOG(INFO) << "Register " << poll_id << " from " << full_message_id << " from " << source; bool is_inserted = poll_messages_[poll_id].insert(full_message_id).second; - LOG_CHECK(is_inserted) << source << " " << poll_id << full_message_id; + LOG_CHECK(is_inserted) << source << " " << poll_id << " " << full_message_id; if (!td_->auth_manager_->is_bot() && !is_local_poll_id(poll_id) && !get_poll_is_closed(poll_id)) { update_poll_timeout_.add_timeout_in(poll_id.get(), 0); } @@ -597,7 +597,7 @@ void PollManager::unregister_poll(PollId poll_id, FullMessageId full_message_id, LOG(INFO) << "Unregister " << poll_id << " from " << full_message_id << " from " << source; auto &message_ids = poll_messages_[poll_id]; auto is_deleted = message_ids.erase(full_message_id); - LOG_CHECK(is_deleted) << source << " " << poll_id << full_message_id; + LOG_CHECK(is_deleted) << source << " " << poll_id << " " << full_message_id; if (message_ids.empty()) { poll_messages_.erase(poll_id); update_poll_timeout_.cancel_timeout(poll_id.get()); diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index e1522586..c3819a34 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -657,7 +657,7 @@ void WebPagesManager::register_web_page(WebPageId web_page_id, FullMessageId ful LOG(INFO) << "Register " << web_page_id << " from " << full_message_id << " from " << source; bool is_inserted = web_page_messages_[web_page_id].insert(full_message_id).second; - LOG_CHECK(is_inserted) << source << " " << web_page_id << full_message_id; + LOG_CHECK(is_inserted) << source << " " << web_page_id << " " << full_message_id; if (!td_->auth_manager_->is_bot() && !have_web_page_force(web_page_id)) { LOG(INFO) << "Waiting for " << web_page_id << " needed in " << full_message_id; @@ -673,7 +673,7 @@ void WebPagesManager::unregister_web_page(WebPageId web_page_id, FullMessageId f LOG(INFO) << "Unregister " << web_page_id << " from " << full_message_id << " from " << source; auto &message_ids = web_page_messages_[web_page_id]; auto is_deleted = message_ids.erase(full_message_id); - LOG_CHECK(is_deleted) << source << " " << web_page_id << full_message_id; + LOG_CHECK(is_deleted) << source << " " << web_page_id << " " << full_message_id; if (message_ids.empty()) { web_page_messages_.erase(web_page_id);