Fix sending quote data with uploaded media.

Fixes #27032.
This commit is contained in:
John Preston 2023-11-10 16:25:55 +04:00
parent 2afc171bec
commit 8d0fe601cf

View file

@ -2904,11 +2904,22 @@ FullStoryId HistoryItem::replyToStory() const {
}
FullReplyTo HistoryItem::replyTo() const {
return {
.messageId = replyToFullId(),
.storyId = replyToStory(),
auto result = FullReplyTo{
.topicRootId = topicRootId(),
};
if (const auto reply = Get<HistoryMessageReply>()) {
const auto &fields = reply->fields();
const auto peer = fields.externalPeerId;
const auto replyToPeer = peer ? peer : _history->peer->id;
if (const auto id = fields.messageId) {
result.messageId = { replyToPeer, id };
result.quote = fields.quote;
}
if (const auto id = fields.storyId) {
result.storyId = { replyToPeer, id };
}
}
return result;
}
void HistoryItem::setText(const TextWithEntities &textWithEntities) {