Add message.saved_messages_topic.

This commit is contained in:
levlam 2024-01-12 16:06:10 +03:00
parent 09e0add01f
commit 0aeb11dee8
3 changed files with 38 additions and 7 deletions

View File

@ -1332,6 +1332,7 @@ inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessag
//@unread_reactions Information about unread reactions added to the message
//@reply_to Information about the message or the story this message is replying to; may be null if none
//@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs
//@saved_messages_topic Information about topic of the message in the Saved Messages chat; may be null for messages not from Saved Messages
//@self_destruct_type The message's self-destruct type; may be null if none
//@self_destruct_in Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet
//@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never
@ -1341,7 +1342,7 @@ inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessag
//@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted
//@content Content of the message
//@reply_markup Reply markup for the message; may be null if none
message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector<unreadReaction> reply_to:MessageReplyTo message_thread_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message;
message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector<unreadReaction> reply_to:MessageReplyTo message_thread_id:int53 saved_messages_topic:SavedMessagesTopic self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message;
//@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null
messages total_count:int32 messages:vector<message> = Messages;
@ -1856,6 +1857,18 @@ webAppInfo launch_id:int64 url:string = WebAppInfo;
messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector<message> draft_message:draftMessage = MessageThreadInfo;
//@class SavedMessagesTopic @description Contains information about a Saved Messages topic
//@description Topic containing messages sent by the current user of forwarded from an unknown chat
savedMessagesTopicMyNotes = SavedMessagesTopic;
//@description Topic containing messages forwarded from a user with hidden privacy
savedMessagesTopicAuthorHidden = SavedMessagesTopic;
//@description Topic containing messages forwarded from a specific chat @chat_id Identifier of the chat
savedMessagesTopicSavedFromChat chat_id:int53 = SavedMessagesTopic;
//@description Describes a forum topic icon @color Color of the topic icon in RGB format @custom_emoji_id Unique identifier of the custom emoji shown on the topic icon; 0 if none
forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon;

View File

@ -22220,6 +22220,21 @@ tl_object_ptr<td_api::MessageSchedulingState> MessagesManager::get_message_sched
return td_api::make_object<td_api::messageSchedulingStateSendAtDate>(send_date);
}
td_api::object_ptr<td_api::SavedMessagesTopic> MessagesManager::get_saved_messages_topic_object(
DialogId saved_messages_dialog_id) const {
if (saved_messages_dialog_id == DialogId()) {
return nullptr;
}
if (saved_messages_dialog_id == td_->dialog_manager_->get_my_dialog_id()) {
return td_api::make_object<td_api::savedMessagesTopicMyNotes>();
}
if (saved_messages_dialog_id == DialogId(static_cast<int64>(2666000))) {
return td_api::make_object<td_api::savedMessagesTopicAuthorHidden>();
}
return td_api::make_object<td_api::savedMessagesTopicSavedFromChat>(
get_chat_id_object(saved_messages_dialog_id, "savedMessagesTopicSavedFromChat"));
}
td_api::object_ptr<td_api::MessageContent> MessagesManager::get_message_message_content_object(DialogId dialog_id,
const Message *m) const {
auto live_location_date = m->is_failed_to_send ? 0 : m->date;
@ -22256,9 +22271,9 @@ td_api::object_ptr<td_api::message> MessagesManager::get_dialog_event_log_messag
m->message_id.get(), std::move(sender), get_chat_id_object(dialog_id, "get_dialog_event_log_message_object"),
nullptr, nullptr, m->is_outgoing, m->is_pinned, false, false, false, can_be_saved, false, false, false, false,
false, false, false, false, true, m->is_channel_post, m->is_topic_message, false, m->date, edit_date,
std::move(forward_info), std::move(import_info), std::move(interaction_info), Auto(), nullptr, 0, nullptr, 0.0,
0.0, via_bot_user_id, m->author_signature, 0, get_restriction_reason_description(m->restriction_reasons),
std::move(content), std::move(reply_markup));
std::move(forward_info), std::move(import_info), std::move(interaction_info), Auto(), nullptr, 0, nullptr,
nullptr, 0.0, 0.0, via_bot_user_id, m->author_signature, 0,
get_restriction_reason_description(m->restriction_reasons), std::move(content), std::move(reply_markup));
}
tl_object_ptr<td_api::message> MessagesManager::get_message_object(MessageFullId message_full_id, const char *source) {
@ -22372,9 +22387,9 @@ tl_object_ptr<td_api::message> MessagesManager::get_message_object(DialogId dial
can_get_media_timestamp_links, can_report_reactions, has_timestamped_media, m->is_channel_post,
m->is_topic_message, m->contains_unread_mention, date, edit_date, std::move(forward_info), std::move(import_info),
std::move(interaction_info), std::move(unread_reactions), std::move(reply_to), top_thread_message_id,
std::move(self_destruct_type), ttl_expires_in, auto_delete_in, via_bot_user_id, m->author_signature,
m->media_album_id, get_restriction_reason_description(m->restriction_reasons), std::move(content),
std::move(reply_markup));
get_saved_messages_topic_object(m->saved_messages_dialog_id), std::move(self_destruct_type), ttl_expires_in,
auto_delete_in, via_bot_user_id, m->author_signature, m->media_album_id,
get_restriction_reason_description(m->restriction_reasons), std::move(content), std::move(reply_markup));
}
tl_object_ptr<td_api::messages> MessagesManager::get_messages_object(int32 total_count, DialogId dialog_id,

View File

@ -2341,6 +2341,9 @@ class MessagesManager final : public Actor {
static tl_object_ptr<td_api::MessageSchedulingState> get_message_scheduling_state_object(int32 send_date);
td_api::object_ptr<td_api::SavedMessagesTopic> get_saved_messages_topic_object(
DialogId saved_messages_dialog_id) const;
td_api::object_ptr<td_api::MessageContent> get_message_message_content_object(DialogId dialog_id,
const Message *m) const;