parent
c7e884c454
commit
495a4334df
@ -71,11 +71,14 @@ EventStore::EventStore(std::string room_id, QObject *)
|
|||||||
fetchMore();
|
fetchMore();
|
||||||
else {
|
else {
|
||||||
if (this->last != std::numeric_limits<uint64_t>::max()) {
|
if (this->last != std::numeric_limits<uint64_t>::max()) {
|
||||||
|
auto oldFirst = this->first;
|
||||||
emit beginInsertRows(toExternalIdx(newFirst),
|
emit beginInsertRows(toExternalIdx(newFirst),
|
||||||
toExternalIdx(this->first - 1));
|
toExternalIdx(this->first - 1));
|
||||||
this->first = newFirst;
|
this->first = newFirst;
|
||||||
emit endInsertRows();
|
emit endInsertRows();
|
||||||
emit fetchedMore();
|
emit fetchedMore();
|
||||||
|
emit dataChanged(toExternalIdx(oldFirst),
|
||||||
|
toExternalIdx(oldFirst));
|
||||||
} else {
|
} else {
|
||||||
auto range = cache::client()->getTimelineRange(room_id_);
|
auto range = cache::client()->getTimelineRange(room_id_);
|
||||||
|
|
||||||
|
@ -354,18 +354,13 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj
|
|||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
connect(this, &TimelineModel::addPendingMessageToStore, &events, &EventStore::addPending);
|
connect(this, &TimelineModel::addPendingMessageToStore, &events, &EventStore::addPending);
|
||||||
|
|
||||||
connect(
|
connect(&events, &EventStore::dataChanged, this, [this](int from, int to) {
|
||||||
&events,
|
|
||||||
&EventStore::dataChanged,
|
|
||||||
this,
|
|
||||||
[this](int from, int to) {
|
|
||||||
relatedEventCacheBuster++;
|
relatedEventCacheBuster++;
|
||||||
nhlog::ui()->debug(
|
nhlog::ui()->debug(
|
||||||
"data changed {} to {}", events.size() - to - 1, events.size() - from - 1);
|
"data changed {} to {}", events.size() - to - 1, events.size() - from - 1);
|
||||||
emit dataChanged(index(events.size() - to - 1, 0),
|
emit dataChanged(index(events.size() - to - 1, 0),
|
||||||
index(events.size() - from - 1, 0));
|
index(events.size() - from - 1, 0));
|
||||||
},
|
});
|
||||||
Qt::QueuedConnection);
|
|
||||||
|
|
||||||
connect(&events, &EventStore::beginInsertRows, this, [this](int from, int to) {
|
connect(&events, &EventStore::beginInsertRows, this, [this](int from, int to) {
|
||||||
int first = events.size() - to;
|
int first = events.size() - to;
|
||||||
|
Loading…
Reference in New Issue
Block a user