Fix day separator when loading older messages

fixes #632
This commit is contained in:
Nicolas Werner 2021-09-08 12:47:44 +02:00
parent c7e884c454
commit 495a4334df
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
2 changed files with 10 additions and 12 deletions

View file

@ -71,11 +71,14 @@ EventStore::EventStore(std::string room_id, QObject *)
fetchMore();
else {
if (this->last != std::numeric_limits<uint64_t>::max()) {
auto oldFirst = this->first;
emit beginInsertRows(toExternalIdx(newFirst),
toExternalIdx(this->first - 1));
this->first = newFirst;
emit endInsertRows();
emit fetchedMore();
emit dataChanged(toExternalIdx(oldFirst),
toExternalIdx(oldFirst));
} else {
auto range = cache::client()->getTimelineRange(room_id_);