Add unread_count to MessageThreadInfo.
This commit is contained in:
parent
84be6f4485
commit
b4dc516b44
@ -1064,9 +1064,10 @@ loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int32 reque
|
|||||||
//@chat_id Identifier of the chat to which the message thread belongs
|
//@chat_id Identifier of the chat to which the message thread belongs
|
||||||
//@message_thread_id Message thread identifier, unique within the chat
|
//@message_thread_id Message thread identifier, unique within the chat
|
||||||
//@reply_info Contains information about the message thread
|
//@reply_info Contains information about the message thread
|
||||||
|
//@unread_message_count Approximate number of unread messages in the message thread
|
||||||
//@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)
|
//@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
|
//@draft_message A draft of a message in the message thread; may be null
|
||||||
messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo messages:vector<message> draft_message:draftMessage = MessageThreadInfo;
|
messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector<message> draft_message:draftMessage = MessageThreadInfo;
|
||||||
|
|
||||||
|
|
||||||
//@class RichText @description Describes a text object inside an instant-view web page
|
//@class RichText @description Describes a text object inside an instant-view web page
|
||||||
|
@ -16,6 +16,7 @@ namespace td {
|
|||||||
struct MessageThreadInfo {
|
struct MessageThreadInfo {
|
||||||
DialogId dialog_id;
|
DialogId dialog_id;
|
||||||
vector<MessageId> message_ids;
|
vector<MessageId> message_ids;
|
||||||
|
int32 unread_message_count = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace td
|
} // namespace td
|
@ -17046,6 +17046,7 @@ void MessagesManager::process_discussion_message_impl(
|
|||||||
|
|
||||||
MessageThreadInfo message_thread_info;
|
MessageThreadInfo message_thread_info;
|
||||||
message_thread_info.dialog_id = expected_dialog_id;
|
message_thread_info.dialog_id = expected_dialog_id;
|
||||||
|
message_thread_info.unread_message_count = max(0, result->unread_count_);
|
||||||
MessageId top_message_id;
|
MessageId top_message_id;
|
||||||
for (auto &message : result->messages_) {
|
for (auto &message : result->messages_) {
|
||||||
auto full_message_id =
|
auto full_message_id =
|
||||||
@ -17160,8 +17161,8 @@ td_api::object_ptr<td_api::messageThreadInfo> MessagesManager::get_message_threa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return td_api::make_object<td_api::messageThreadInfo>(d->dialog_id.get(), top_thread_message_id.get(),
|
return td_api::make_object<td_api::messageThreadInfo>(d->dialog_id.get(), top_thread_message_id.get(),
|
||||||
std::move(reply_info), std::move(messages),
|
std::move(reply_info), info.unread_message_count,
|
||||||
std::move(draft_message));
|
std::move(messages), std::move(draft_message));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagesManager::get_dialog_info_full(DialogId dialog_id, Promise<Unit> &&promise, const char *source) {
|
void MessagesManager::get_dialog_info_full(DialogId dialog_id, Promise<Unit> &&promise, const char *source) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user