From 8ca5e11e3f647fe350eb28fc4dd7b127897cf158 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 12 Mar 2020 19:56:42 +0300 Subject: [PATCH] Add draftMessage.date. GitOrigin-RevId: 5fea574e388a14fed3186b5c97a2a830181d6e98 --- td/generate/scheme/td_api.tl | 7 +++++-- td/generate/scheme/td_api.tlo | Bin 167928 -> 167960 bytes td/telegram/DraftMessage.cpp | 2 +- td/telegram/MessagesManager.cpp | 7 ++++--- td/telegram/cli.cpp | 5 +++-- 5 files changed, 13 insertions(+), 8 deletions(-) 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 095ff3672fdf07f7ec38680a38a4b983f29caf55..f9f3b663060338ff2e3ceab4d826a8b6abf54248 100644 GIT binary patch delta 128 zcmew{pKHbft_>DEERW8uvfFIKQ{f6>?Fc+zCJPedNhwN9EAdS&E>28OWnf?ciQPOV z1Lenc%M;z`=4BDEEZcN)3OC#ERJcM|I|2`w$%4dqQi>AON_ 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") {