Introduce messageReplyInfo.

GitOrigin-RevId: 10e757b71fde4e29aa81905bfba5fc4ca5523bbb
This commit is contained in:
levlam 2020-10-01 16:12:20 +03:00
parent d66c404f3a
commit c332f26352
3 changed files with 19 additions and 19 deletions

View File

@ -639,15 +639,19 @@ messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:stri
//@from_message_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown
messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo;
//@description Contains information about message replies
//@reply_count Number of times the message was directly or indirectly replied
//@recent_replier_user_ids User identifiers of the recent repliers to the message; available in channels with a discussion supergroup
//@last_read_inbox_message_id Identifier of the last read incoming reply to the message
//@last_read_outbox_message_id Identifier of the last read outgoing reply to the message
//@last_message_id Identifier of the last reply to the message
messageReplyInfo reply_count:int32 recent_replier_user_ids:vector<int32> last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 last_message_id:int53 = MessageReplyInfo;
//@description Contains information about interactions with a message
//@view_count Number of times the message was viewed
//@forward_count Number of times the message was forwarded
//@reply_count Number of times the message was directly or indirectly replied; available in discussion supergroups and channels with a discussion supergroup
//@recent_replier_user_ids User identifiers of the recent repliers to the message; available in channels with a discussion supergroup
//@last_read_inbox_comment_message_id Identifier of the last read incoming comment to the message
//@last_read_outbox_comment_message_id Identifier of the last read outgoing comment to the message
//@last_comment_message_id Identifier of the last comment to the message
messageInteractionInfo view_count:int32 forward_count:int32 reply_count:int32 recent_replier_user_ids:vector<int32> last_read_inbox_comment_message_id:int53 last_read_outbox_comment_message_id:int53 last_comment_message_id:int53 = MessageInteractionInfo;
//@reply_info Contains information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself
messageInteractionInfo view_count:int32 forward_count:int32 reply_info:messageReplyInfo = MessageInteractionInfo;
//@class MessageSendingState @description Contains information about the sending state of the message

Binary file not shown.

View File

@ -6543,27 +6543,23 @@ td_api::object_ptr<td_api::messageInteractionInfo> MessagesManager::get_message_
return nullptr;
}
int32 reply_count = -1;
vector<UserId> recent_replier_user_ids;
MessageId last_read_inbox_message_id;
MessageId last_read_outbox_message_id;
MessageId max_message_id;
td_api::object_ptr<td_api::messageReplyInfo> reply_info;
if (is_visible_reply_info) {
reply_count = m->reply_info.reply_count;
vector<UserId> recent_replier_user_ids;
for (auto recent_replier_dialog_id : m->reply_info.recent_replier_dialog_ids) {
if (recent_replier_dialog_id.get_type() == DialogType::User) {
recent_replier_user_ids.push_back(recent_replier_dialog_id.get_user_id());
}
}
last_read_inbox_message_id = m->reply_info.last_read_inbox_message_id;
last_read_outbox_message_id = m->reply_info.last_read_outbox_message_id;
max_message_id = m->reply_info.max_message_id;
reply_info = td_api::make_object<td_api::messageReplyInfo>(
m->reply_info.reply_count,
td_->contacts_manager_->get_user_ids_object(recent_replier_user_ids, "get_message_interaction_info_object"),
m->reply_info.last_read_inbox_message_id.get(), m->reply_info.last_read_outbox_message_id.get(),
m->reply_info.max_message_id.get());
CHECK(reply_info->reply_count_ >= 0);
}
return td_api::make_object<td_api::messageInteractionInfo>(
m->view_count, m->forward_count, reply_count,
td_->contacts_manager_->get_user_ids_object(recent_replier_user_ids, "get_message_interaction_info_object"),
last_read_inbox_message_id.get(), last_read_outbox_message_id.get(), max_message_id.get());
return td_api::make_object<td_api::messageInteractionInfo>(m->view_count, m->forward_count, std::move(reply_info));
}
bool MessagesManager::update_message_interaction_info(DialogId dialog_id, Message *m, int32 view_count,