diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-01-24 20:02:24 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-01-24 20:02:24 +0100 |
commit | f0102c1e55bbe686d0cf799bc4e3d3a4cc643ffd (patch) | |
tree | 5c4596a8f5d2437f4cb0a542eafac159766f392c /src/timeline/EventStore.cpp | |
parent | Merge pull request #405 from rnhmjoj/move-state (diff) | |
download | nheko-f0102c1e55bbe686d0cf799bc4e3d3a4cc643ffd.tar.xz |
Fix old messages being played back after limit reset
Diffstat (limited to '')
-rw-r--r-- | src/timeline/EventStore.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp index d7629456..b16bf1d2 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp @@ -229,6 +229,9 @@ EventStore::clearTimeline() } nhlog::ui()->info("Range {} {}", this->last, this->first); + decryptedEvents_.clear(); + events_.clear(); + emit endResetModel(); } @@ -265,6 +268,9 @@ EventStore::handleSync(const mtx::responses::Timeline &events) emit beginResetModel(); this->first = std::numeric_limits<uint64_t>::max(); this->last = std::numeric_limits<uint64_t>::max(); + + decryptedEvents_.clear(); + events_.clear(); emit endResetModel(); return; } @@ -273,6 +279,9 @@ EventStore::handleSync(const mtx::responses::Timeline &events) emit beginResetModel(); this->last = range->last; this->first = range->first; + + decryptedEvents_.clear(); + events_.clear(); emit endResetModel(); } else if (range->last > this->last) { emit beginInsertRows(toExternalIdx(this->last + 1), toExternalIdx(range->last)); |