Add draftMessage.date.

GitOrigin-RevId: 5fea574e388a14fed3186b5c97a2a830181d6e98
This commit is contained in:
levlam 2020-03-12 19:56:42 +03:00
parent 01de03a3ee
commit 8ca5e11e3f
5 changed files with 13 additions and 8 deletions

View File

@ -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

Binary file not shown.

View File

@ -18,7 +18,7 @@ td_api::object_ptr<td_api::draftMessage> get_draft_message_object(const unique_p
if (draft_message == nullptr) {
return nullptr;
}
return td_api::make_object<td_api::draftMessage>(draft_message->reply_to_message_id.get(),
return td_api::make_object<td_api::draftMessage>(draft_message->reply_to_message_id.get(), draft_message->date,
get_input_message_text_object(draft_message->input_message_text));
}

View File

@ -23597,10 +23597,11 @@ bool MessagesManager::update_dialog_draft_message(Dialog *d, unique_ptr<DraftMes
if (d->draft_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 {

View File

@ -2782,8 +2782,9 @@ class CliClient final : public Actor {
td_api::make_object<td_api::textEntity>(0, 1, td_api::make_object<td_api::textEntityTypePre>()));
draft_message = td_api::make_object<td_api::draftMessage>(
as_message_id(reply_to_message_id), td_api::make_object<td_api::inputMessageText>(
as_formatted_text(message, std::move(entities)), true, false));
as_message_id(reply_to_message_id), 0,
td_api::make_object<td_api::inputMessageText>(as_formatted_text(message, std::move(entities)), true,
false));
}
send_request(td_api::make_object<td_api::setChatDraftMessage>(as_chat_id(chat_id), std::move(draft_message)));
} else if (op == "cadm") {