mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-12-01 14:58:47 +03:00
Fix old messages being played back after limit reset
This commit is contained in:
parent
fc76a939bb
commit
f0102c1e55
1 changed files with 9 additions and 0 deletions
|
@ -229,6 +229,9 @@ EventStore::clearTimeline()
|
||||||
}
|
}
|
||||||
nhlog::ui()->info("Range {} {}", this->last, this->first);
|
nhlog::ui()->info("Range {} {}", this->last, this->first);
|
||||||
|
|
||||||
|
decryptedEvents_.clear();
|
||||||
|
events_.clear();
|
||||||
|
|
||||||
emit endResetModel();
|
emit endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,6 +268,9 @@ EventStore::handleSync(const mtx::responses::Timeline &events)
|
||||||
emit beginResetModel();
|
emit beginResetModel();
|
||||||
this->first = std::numeric_limits<uint64_t>::max();
|
this->first = std::numeric_limits<uint64_t>::max();
|
||||||
this->last = std::numeric_limits<uint64_t>::max();
|
this->last = std::numeric_limits<uint64_t>::max();
|
||||||
|
|
||||||
|
decryptedEvents_.clear();
|
||||||
|
events_.clear();
|
||||||
emit endResetModel();
|
emit endResetModel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -273,6 +279,9 @@ EventStore::handleSync(const mtx::responses::Timeline &events)
|
||||||
emit beginResetModel();
|
emit beginResetModel();
|
||||||
this->last = range->last;
|
this->last = range->last;
|
||||||
this->first = range->first;
|
this->first = range->first;
|
||||||
|
|
||||||
|
decryptedEvents_.clear();
|
||||||
|
events_.clear();
|
||||||
emit endResetModel();
|
emit endResetModel();
|
||||||
} else if (range->last > this->last) {
|
} else if (range->last > this->last) {
|
||||||
emit beginInsertRows(toExternalIdx(this->last + 1), toExternalIdx(range->last));
|
emit beginInsertRows(toExternalIdx(this->last + 1), toExternalIdx(range->last));
|
||||||
|
|
Loading…
Reference in a new issue