diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index f9c4e7c9..589bcbf6 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -615,8 +615,11 @@ chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_so scopeNotificationSettings mute_for:int32 sound:string show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; -//@description Contains information about a message draft @reply_to_message_id Identifier of the message to reply to; 0 if none @input_message_text Content of the message draft; this should always be of type inputMessageText -draftMessage reply_to_message_id:int53 input_message_text:InputMessageContent = DraftMessage; +//@description Contains information about a message draft +//@reply_to_message_id Identifier of the message to reply to; 0 if none +//@date Point in time (Unix timestamp) when the draft was created +//@input_message_text Content of the message draft; this should always be of type inputMessageText +draftMessage reply_to_message_id:int53 date:int53 input_message_text:InputMessageContent = DraftMessage; //@class ChatType @description Describes the type of a chat diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 095ff367..f9f3b663 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/DraftMessage.cpp b/td/telegram/DraftMessage.cpp index e5a3e7c9..c166ac29 100644 --- a/td/telegram/DraftMessage.cpp +++ b/td/telegram/DraftMessage.cpp @@ -18,7 +18,7 @@ td_api::object_ptr get_draft_message_object(const unique_p if (draft_message == nullptr) { return nullptr; } - return td_api::make_object(draft_message->reply_to_message_id.get(), + return td_api::make_object(draft_message->reply_to_message_id.get(), draft_message->date, get_input_message_text_object(draft_message->input_message_text)); } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 35773cd9..51aaa010 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -23597,10 +23597,11 @@ bool MessagesManager::update_dialog_draft_message(Dialog *d, unique_ptrdraft_message != nullptr && d->draft_message->reply_to_message_id == draft_message->reply_to_message_id && d->draft_message->input_message_text == draft_message->input_message_text) { if (d->draft_message->date < draft_message->date) { - if (need_update_dialog_pos) { - update_dialog_pos(d, false, "update_dialog_draft_message 2"); - } d->draft_message->date = draft_message->date; + if (need_update_dialog_pos) { + update_dialog_pos(d, false, "update_dialog_draft_message 2", false); + } + send_update_chat_draft_message(d); return true; } } else { diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 45b958b4..7c1784b5 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2782,8 +2782,9 @@ class CliClient final : public Actor { td_api::make_object(0, 1, td_api::make_object())); draft_message = td_api::make_object( - as_message_id(reply_to_message_id), td_api::make_object( - as_formatted_text(message, std::move(entities)), true, false)); + as_message_id(reply_to_message_id), 0, + td_api::make_object(as_formatted_text(message, std::move(entities)), true, + false)); } send_request(td_api::make_object(as_chat_id(chat_id), std::move(draft_message))); } else if (op == "cadm") {