mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
parent
c7e884c454
commit
495a4334df
2 changed files with 10 additions and 12 deletions
|
@ -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_);
|
||||
|
||||
|
|
|
@ -354,18 +354,13 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj
|
|||
Qt::QueuedConnection);
|
||||
connect(this, &TimelineModel::addPendingMessageToStore, &events, &EventStore::addPending);
|
||||
|
||||
connect(
|
||||
&events,
|
||||
&EventStore::dataChanged,
|
||||
this,
|
||||
[this](int from, int to) {
|
||||
relatedEventCacheBuster++;
|
||||
nhlog::ui()->debug(
|
||||
"data changed {} to {}", events.size() - to - 1, events.size() - from - 1);
|
||||
emit dataChanged(index(events.size() - to - 1, 0),
|
||||
index(events.size() - from - 1, 0));
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
connect(&events, &EventStore::dataChanged, this, [this](int from, int to) {
|
||||
relatedEventCacheBuster++;
|
||||
nhlog::ui()->debug(
|
||||
"data changed {} to {}", events.size() - to - 1, events.size() - from - 1);
|
||||
emit dataChanged(index(events.size() - to - 1, 0),
|
||||
index(events.size() - from - 1, 0));
|
||||
});
|
||||
|
||||
connect(&events, &EventStore::beginInsertRows, this, [this](int from, int to) {
|
||||
int first = events.size() - to;
|
||||
|
|
Loading…
Reference in a new issue