Fix marking stories as read.
This commit is contained in:
parent
99926be57a
commit
c2805d92a5
|
@ -286,7 +286,10 @@ void Stories::processExpired() {
|
||||||
void Stories::parseAndApply(const MTPUserStories &stories) {
|
void Stories::parseAndApply(const MTPUserStories &stories) {
|
||||||
const auto &data = stories.data();
|
const auto &data = stories.data();
|
||||||
const auto peerId = peerFromUser(data.vuser_id());
|
const auto peerId = peerFromUser(data.vuser_id());
|
||||||
const auto readTill = data.vmax_read_id().value_or_empty();
|
const auto already = _readTill.find(peerId);
|
||||||
|
const auto readTill = std::max(
|
||||||
|
data.vmax_read_id().value_or_empty(),
|
||||||
|
(already != end(_readTill) ? already->second : 0));
|
||||||
const auto user = _owner->peer(peerId)->asUser();
|
const auto user = _owner->peer(peerId)->asUser();
|
||||||
auto result = StoriesSource{
|
auto result = StoriesSource{
|
||||||
.user = user,
|
.user = user,
|
||||||
|
|
Loading…
Reference in New Issue