2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Update API scheme to layer 167.

Support quote offset passing to API.
Support simple phrases in giveaway results message.
This commit is contained in:
John Preston
2023-11-10 13:27:47 +04:00
parent f442d69cb6
commit dcc326e17f
44 changed files with 389 additions and 303 deletions

View File

@@ -72,7 +72,7 @@ MTPInputReplyTo ReplyToForMTP(
| (external ? Flag::f_reply_to_peer_id : Flag())
| (replyTo.quote.text.isEmpty()
? Flag()
: Flag::f_quote_text)
: (Flag::f_quote_text | Flag::f_quote_offset))
| (quoteEntities.v.isEmpty()
? Flag()
: Flag::f_quote_entities)),
@@ -82,7 +82,8 @@ MTPInputReplyTo ReplyToForMTP(
? owner->peer(replyTo.messageId.peer)->input
: MTPInputPeer()),
MTP_string(replyTo.quote.text),
quoteEntities);
quoteEntities,
MTP_int(replyTo.quoteOffset));
}
return MTPInputReplyTo();
}
@@ -983,6 +984,7 @@ int Histories::sendPreparedMessage(
.quote = replyTo.quote,
.storyId = replyTo.storyId,
.topicRootId = convertTopicReplyToId(history, replyTo.topicRootId),
.quoteOffset = replyTo.quoteOffset,
};
return v::match(message(history, realReplyTo), [&](const auto &request) {
const auto type = RequestType::Send;

View File

@@ -161,6 +161,7 @@ struct FullReplyTo {
TextWithEntities quote;
FullStoryId storyId;
MsgId topicRootId = 0;
int quoteOffset = 0;
[[nodiscard]] bool valid() const {
return messageId || (storyId && peerIsUser(storyId.peer));