More correct way of applying min stories.

This commit is contained in:
John Preston 2023-09-14 10:58:29 +04:00
parent 0f8d9e885a
commit 98ab91a56a

View file

@ -469,7 +469,9 @@ void Story::applyFields(
bool initial) {
_lastUpdateTime = now;
const auto reaction = data.vsent_reaction()
const auto reaction = data.is_min()
? _sentReactionId
: data.vsent_reaction()
? Data::ReactionFromMTP(*data.vsent_reaction())
: Data::ReactionId();
const auto pinned = data.is_pinned();
@ -493,7 +495,6 @@ void Story::applyFields(
auto views = _views.total;
auto reactions = _views.reactions;
auto viewers = std::vector<not_null<PeerData*>>();
if (!data.is_min()) {
if (const auto info = data.vviews()) {
views = info->data().vviews_count().v;
reactions = info->data().vreactions_count().v;
@ -506,7 +507,8 @@ void Story::applyFields(
viewers.push_back(owner.peer(peerFromUser(id)));
}
}
}
} else {
viewers = _recentViewers;
}
auto locations = std::vector<StoryLocation>();
if (const auto areas = data.vmedia_areas()) {