Update API scheme on layer 174.

This commit is contained in:
John Preston 2024-02-12 12:45:37 +04:00
parent 964846f1bb
commit 11f0847295
5 changed files with 11 additions and 13 deletions

View File

@ -40,11 +40,9 @@ MTPInputReplyTo ReplyToForMTP(
const auto owner = &history->owner();
if (replyTo.storyId) {
if (const auto peer = owner->peerLoaded(replyTo.storyId.peer)) {
if (const auto user = peer->asUser()) {
return MTP_inputReplyToStory(
user->inputUser,
MTP_int(replyTo.storyId.story));
}
return MTP_inputReplyToStory(
peer->input,
MTP_int(replyTo.storyId.story));
}
} else if (replyTo.messageId || replyTo.topicRootId) {
const auto to = LookupReplyTo(history, replyTo.messageId);

View File

@ -164,7 +164,7 @@ struct FullReplyTo {
int quoteOffset = 0;
[[nodiscard]] bool valid() const {
return messageId || (storyId && peerIsUser(storyId.peer));
return messageId || (storyId && storyId.peer);
}
explicit operator bool() const {
return valid();

View File

@ -330,7 +330,7 @@ ReplyFields ReplyFieldsFromMTP(
return result;
}, [&](const MTPDmessageReplyStoryHeader &data) {
return ReplyFields{
.externalPeerId = peerFromUser(data.vuser_id()),
.externalPeerId = peerFromMTP(data.vpeer()),
.storyId = data.vstory_id().v,
};
});
@ -362,9 +362,9 @@ FullReplyTo ReplyToFromMTP(
result.quoteOffset = data.vquote_offset().value_or_empty();
return result;
}, [&](const MTPDinputReplyToStory &data) {
if (const auto parsed = Data::UserFromInputMTP(
if (const auto parsed = Data::PeerFromInputMTP(
&history->owner(),
data.vuser_id())) {
data.vpeer())) {
return FullReplyTo{
.storyId = { parsed->id, data.vstory_id().v },
};

View File

@ -416,7 +416,7 @@ MTPMessageReplyHeader NewMessageReplyHeader(const Api::SendAction &action) {
if (const auto replyTo = action.replyTo) {
if (replyTo.storyId) {
return MTP_messageReplyStoryHeader(
MTP_long(peerToUser(replyTo.storyId.peer).bare),
peerToMTP(replyTo.storyId.peer),
MTP_int(replyTo.storyId.story));
}
using Flag = MTPDmessageReplyHeader::Flag;

View File

@ -1277,7 +1277,7 @@ messages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> use
messages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector<Chat> users:Vector<User> = 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<MessageEntity> quote_offset:flags.10?int = MessageReplyHeader;
messageReplyStoryHeader#9c98bfc1 user_id:long story_id: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<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
@ -1556,7 +1556,7 @@ storyViews#8d595cd6 flags:# has_viewers:flags.1?true views_count:int forwards_co
storyItemDeleted#51e6ee4f id:int = StoryItem;
storyItemSkipped#ffadc913 flags:# close_friends:flags.8?true id:int date:int expire_date:int = StoryItem;
storyItem#af6365a1 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem;
storyItem#79b26a24 flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem;
stories.allStoriesNotModified#1158fe3e flags:# state:string stealth_mode:StoriesStealthMode = stories.AllStories;
stories.allStories#6efc5e81 flags:# has_more:flags.0?true count:int state:string peer_stories:Vector<PeerStories> chats:Vector<Chat> users:Vector<User> stealth_mode:StoriesStealthMode = stories.AllStories;
@ -1572,7 +1572,7 @@ stories.storyViewsList#59d78fc5 flags:# count:int views_count:int forwards_count
stories.storyViews#de9eed1d views:Vector<StoryViews> users:Vector<User> = stories.StoryViews;
inputReplyToMessage#22c0f6d5 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<MessageEntity> quote_offset:flags.4?int = InputReplyTo;
inputReplyToStory#15b0f283 user_id:InputUser story_id:int = InputReplyTo;
inputReplyToStory#5881323a peer:InputPeer story_id:int = InputReplyTo;
exportedStoryLink#3fc9053b link:string = ExportedStoryLink;