diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index fa9a6a1b1..89e561b90 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -4498,7 +4498,6 @@ void MessagesManager::Message::store(StorerT &storer) const { STORE_FLAG(has_reply_in_dialog_id); STORE_FLAG(has_top_reply_message_id); STORE_FLAG(has_thread_draft_message); - STORE_FLAG(is_in_thread); END_STORE_FLAGS(); } @@ -4688,7 +4687,6 @@ void MessagesManager::Message::parse(ParserT &parser) { PARSE_FLAG(has_reply_in_dialog_id); PARSE_FLAG(has_top_reply_message_id); PARSE_FLAG(has_thread_draft_message); - PARSE_FLAG(is_in_thread); END_PARSE_FLAGS(); } @@ -22015,14 +22013,17 @@ Result MessagesManager::send_message(DialogId dialog_id, MessageId to m->via_bot_user_id = message_content.via_bot_user_id; m->disable_web_page_preview = message_content.disable_web_page_preview; m->clear_draft = message_content.clear_draft; - m->is_in_thread = top_thread_message_id.is_valid(); if (message_content.ttl > 0) { m->ttl = message_content.ttl; m->is_content_secret = is_secret_message_content(m->ttl, m->content->get_type()); } if (message_content.clear_draft) { - update_dialog_draft_message(d, nullptr, false, !need_update_dialog_pos); + if (top_thread_message_id.is_valid()) { + set_dialog_draft_message(dialog_id, top_thread_message_id, nullptr).ignore(); + } else { + update_dialog_draft_message(d, nullptr, false, !need_update_dialog_pos); + } } save_send_message_log_event(dialog_id, m); @@ -22246,7 +22247,6 @@ Result> MessagesManager::send_message_group( m->is_content_secret = is_secret_message_content(m->ttl, m->content->get_type()); } m->media_album_id = media_album_id; - m->is_in_thread = top_thread_message_id.is_valid(); save_send_message_log_event(dialog_id, m); do_send_message(dialog_id, m); @@ -23030,9 +23030,12 @@ Result MessagesManager::send_inline_query_result_message(DialogId dia } m->disable_web_page_preview = content->disable_web_page_preview; m->clear_draft = true; - m->is_in_thread = top_thread_message_id.is_valid(); - update_dialog_draft_message(d, nullptr, false, !need_update_dialog_pos); + if (top_thread_message_id.is_valid()) { + set_dialog_draft_message(dialog_id, top_thread_message_id, nullptr).ignore(); + } else { + update_dialog_draft_message(d, nullptr, false, !need_update_dialog_pos); + } send_update_new_message(d, m); if (need_update_dialog_pos) { @@ -24733,7 +24736,6 @@ Result> MessagesManager::forward_messages(DialogId to_dialog_i m->media_album_id = new_media_album_ids[copied_message.media_album_id].first; } m->reply_markup = std::move(copied_message.reply_markup); - m->is_in_thread = copied_message.top_thread_message_id.is_valid(); save_send_message_log_event(to_dialog_id, m); do_send_message(to_dialog_id, m); @@ -24849,7 +24851,6 @@ Result> MessagesManager::resend_messages(DialogId dialog_id, v m->ttl = message->ttl; m->is_content_secret = message->is_content_secret; m->media_album_id = new_media_album_ids[message->media_album_id].first; - m->is_in_thread = message->is_in_thread; save_send_message_log_event(dialog_id, m); do_send_message(dialog_id, m); diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index d8e744d93..d092a2bd2 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -1059,7 +1059,6 @@ class MessagesManager : public Actor { bool in_game_share = false; // for send_message bool hide_via_bot = false; // for resend_message bool is_bot_start_message = false; // for resend_message - bool is_in_thread = false; // for resend_message bool have_previous = false; bool have_next = false;