From 23f5102f1b3e34b0736277057179fb924bb7aa06 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 7 Jul 2025 10:59:37 +0400 Subject: [PATCH] Update API scheme to layer 208. --- Telegram/SourceFiles/data/data_histories.cpp | 6 ++++-- Telegram/SourceFiles/data/data_msg_id.h | 1 + .../history/admin_log/history_admin_log_item.cpp | 3 ++- Telegram/SourceFiles/history/history_item_components.cpp | 1 + Telegram/SourceFiles/history/history_item_components.h | 1 + Telegram/SourceFiles/history/history_item_helpers.cpp | 6 ++++-- Telegram/SourceFiles/mtproto/scheme/api.tl | 6 +++--- 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/data/data_histories.cpp b/Telegram/SourceFiles/data/data_histories.cpp index 5f75f22ea5..f114f6d433 100644 --- a/Telegram/SourceFiles/data/data_histories.cpp +++ b/Telegram/SourceFiles/data/data_histories.cpp @@ -88,7 +88,8 @@ MTPInputReplyTo ReplyToForMTP( : Flag()) | (quoteEntities.v.isEmpty() ? Flag() - : Flag::f_quote_entities)), + : Flag::f_quote_entities) + | (replyTo.todoItemId ? Flag::f_todo_item_id : Flag())), MTP_int(replyTo.messageId ? replyTo.messageId.msg : 0), MTP_int(replyTo.topicRootId), (external @@ -99,7 +100,8 @@ MTPInputReplyTo ReplyToForMTP( MTP_int(replyTo.quoteOffset), (replyToMonoforumPeerId ? history->owner().peer(replyToMonoforumPeerId)->input - : MTPInputPeer())); + : MTPInputPeer()), + MTP_int(replyTo.todoItemId)); } else if (history->peer->amMonoforumAdmin() && replyTo.monoforumPeerId) { const auto replyToMonoforumPeer = replyTo.monoforumPeerId diff --git a/Telegram/SourceFiles/data/data_msg_id.h b/Telegram/SourceFiles/data/data_msg_id.h index bee8324194..68437b6fd3 100644 --- a/Telegram/SourceFiles/data/data_msg_id.h +++ b/Telegram/SourceFiles/data/data_msg_id.h @@ -179,6 +179,7 @@ struct FullReplyTo { MsgId topicRootId = 0; PeerId monoforumPeerId = 0; int quoteOffset = 0; + int todoItemId = 0; [[nodiscard]] bool replying() const { return messageId || (storyId && storyId.peer); diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp index 0f656950b4..618af25507 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_item.cpp @@ -111,7 +111,8 @@ std::optional PrepareLogReply( MTP_int(topId), MTPstring(), // quote_text MTPVector(), // quote_entities - MTPint()); // quote_offset + MTPint(), // quote_offset + MTPint()); // todo_item_id } } return {}; diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp index 3cb8a49bb7..82c091e56f 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp @@ -386,6 +386,7 @@ ReplyFields ReplyFieldsFromMTP( = data.vreply_to_top_id().value_or(result.messageId.bare); result.topicPost = data.is_forum_topic() ? 1 : 0; } + result.todoItemId = data.vtodo_item_id().value_or_empty(); if (const auto header = data.vreply_from()) { const auto &data = header->data(); result.externalPostAuthor diff --git a/Telegram/SourceFiles/history/history_item_components.h b/Telegram/SourceFiles/history/history_item_components.h index 4ca58bde84..6b1cfbb495 100644 --- a/Telegram/SourceFiles/history/history_item_components.h +++ b/Telegram/SourceFiles/history/history_item_components.h @@ -277,6 +277,7 @@ struct ReplyFields { MsgId messageId = 0; MsgId topMessageId = 0; StoryId storyId = 0; + int todoItemId = 0; uint32 quoteOffset : 30 = 0; uint32 manualQuote : 1 = 0; uint32 topicPost : 1 = 0; diff --git a/Telegram/SourceFiles/history/history_item_helpers.cpp b/Telegram/SourceFiles/history/history_item_helpers.cpp index 33bea8bc66..cebe57e5c4 100644 --- a/Telegram/SourceFiles/history/history_item_helpers.cpp +++ b/Telegram/SourceFiles/history/history_item_helpers.cpp @@ -899,7 +899,8 @@ MTPMessageReplyHeader NewMessageReplyHeader(const Api::SendAction &action) { | Flag::f_quote_offset)) | (quoteEntities.v.empty() ? Flag() - : Flag::f_quote_entities)), + : Flag::f_quote_entities) + | (replyTo.todoItemId ? Flag::f_todo_item_id : Flag())), MTP_int(replyTo.messageId.msg), peerToMTP(externalPeerId), MTPMessageFwdHeader(), // reply_from @@ -907,7 +908,8 @@ MTPMessageReplyHeader NewMessageReplyHeader(const Api::SendAction &action) { MTP_int(replyToTop), MTP_string(replyTo.quote.text), quoteEntities, - MTP_int(replyTo.quoteOffset)); + MTP_int(replyTo.quoteOffset), + MTP_int(replyTo.todoItemId)); } return MTPMessageReplyHeader(); } diff --git a/Telegram/SourceFiles/mtproto/scheme/api.tl b/Telegram/SourceFiles/mtproto/scheme/api.tl index e33dd8366b..39b5af7c5b 100644 --- a/Telegram/SourceFiles/mtproto/scheme/api.tl +++ b/Telegram/SourceFiles/mtproto/scheme/api.tl @@ -1344,7 +1344,7 @@ messages.messageViews#b6c4f543 views:Vector chats:Vector use messages.discussionMessage#a6341782 flags:# messages:Vector max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector users:Vector = messages.DiscussionMessage; -messageReplyHeader#afbc09db flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector quote_offset:flags.10?int = MessageReplyHeader; +messageReplyHeader#6917560b flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector quote_offset:flags.10?int todo_item_id:flags.11?int = MessageReplyHeader; messageReplyStoryHeader#e5af939 peer:Peer story_id:int = MessageReplyHeader; messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies; @@ -1649,7 +1649,7 @@ stories.storyViewsList#59d78fc5 flags:# count:int views_count:int forwards_count stories.storyViews#de9eed1d views:Vector users:Vector = stories.StoryViews; -inputReplyToMessage#b07038b0 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer = InputReplyTo; +inputReplyToMessage#869fbe10 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer todo_item_id:flags.6?int = InputReplyTo; inputReplyToStory#5881323a peer:InputPeer story_id:int = InputReplyTo; inputReplyToMonoForum#69d66c45 monoforum_peer_id:InputPeer = InputReplyTo; @@ -2720,4 +2720,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool; fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; -// LAYER 207 +// LAYER 208