Apply initial forwards count from the message.

This commit is contained in:
John Preston 2022-12-15 11:39:34 +04:00
parent 1b73b34810
commit ccb3bbea15

View file

@ -92,6 +92,7 @@ struct HistoryItem::CreateConfig {
bool replyIsTopicPost = false;
UserId viaBotId = 0;
int viewsCount = -1;
int forwardsCount = -1;
QString author;
PeerId senderOriginal = 0;
QString senderNameOriginal;
@ -2705,6 +2706,7 @@ void HistoryItem::createComponents(CreateConfig &&config) {
}
}
}
setForwardsCount(config.forwardsCount);
setReplies(std::move(config.replies));
}
if (const auto edited = Get<HistoryMessageEdited>()) {
@ -2986,6 +2988,7 @@ void HistoryItem::createComponents(const MTPDmessage &data) {
}
config.viaBotId = data.vvia_bot_id().value_or_empty();
config.viewsCount = data.vviews().value_or(-1);
config.forwardsCount = data.vforwards().value_or(-1);
config.replies = isScheduled()
? HistoryMessageRepliesData()
: HistoryMessageRepliesData(data.vreplies());