Add chat_id and message_thread_id to messageThreadInfo.
GitOrigin-RevId: 57945b02f90e74aba10e519f0f140e97f5447f9b
This commit is contained in:
parent
25676d7ff0
commit
e2a596e11f
@ -976,9 +976,11 @@ loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int32 reque
|
||||
|
||||
|
||||
//@description Contains information about a message thread
|
||||
//@chat_id Identifier of the chat to which the message thread belongs
|
||||
//@message_thread_id Message thread identifier, unique within the chat
|
||||
//@messages The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
|
||||
//@draft_message A draft of a message in the message thread; may be null
|
||||
messageThreadInfo messages:vector<message> draft_message:draftMessage = MessageThreadInfo;
|
||||
messageThreadInfo chat_id:int53 message_thread_id:int53 messages:vector<message> draft_message:draftMessage = MessageThreadInfo;
|
||||
|
||||
|
||||
//@class RichText @description Describes a text object inside an instant-view web page
|
||||
|
Binary file not shown.
@ -15899,6 +15899,10 @@ void MessagesManager::on_get_discussion_message(DialogId dialog_id, MessageId me
|
||||
|
||||
td_api::object_ptr<td_api::messageThreadInfo> MessagesManager::get_message_thread_info_object(
|
||||
const MessageThreadInfo &info) {
|
||||
if (info.message_ids.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Dialog *d = get_dialog(info.dialog_id);
|
||||
CHECK(d != nullptr);
|
||||
vector<td_api::object_ptr<td_api::message>> messages;
|
||||
@ -15910,14 +15914,17 @@ td_api::object_ptr<td_api::messageThreadInfo> MessagesManager::get_message_threa
|
||||
}
|
||||
}
|
||||
|
||||
MessageId top_thread_message_id;
|
||||
td_api::object_ptr<td_api::draftMessage> draft_message;
|
||||
if (!info.message_ids.empty() && can_send_message(d->dialog_id).is_ok()) {
|
||||
const Message *m = get_message_force(d, info.message_ids.back(), "get_message_thread_info_object 2");
|
||||
top_thread_message_id = info.message_ids.back();
|
||||
const Message *m = get_message_force(d, top_thread_message_id, "get_message_thread_info_object 2");
|
||||
if (m != nullptr && !m->reply_info.is_comment && is_active_message_reply_info(d->dialog_id, m->reply_info)) {
|
||||
draft_message = get_draft_message_object(m->thread_draft_message);
|
||||
}
|
||||
}
|
||||
return td_api::make_object<td_api::messageThreadInfo>(std::move(messages), std::move(draft_message));
|
||||
return td_api::make_object<td_api::messageThreadInfo>(d->dialog_id.get(), top_thread_message_id.get(),
|
||||
std::move(messages), std::move(draft_message));
|
||||
}
|
||||
|
||||
void MessagesManager::get_dialog_info_full(DialogId dialog_id, Promise<Unit> &&promise) {
|
||||
|
Loading…
Reference in New Issue
Block a user