Rename initialize to sync, since it does the same thing
This commit is contained in:
parent
e2d733a01a
commit
0d3c9390c6
@ -566,7 +566,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
|||||||
connect(this,
|
connect(this,
|
||||||
&ChatPage::initializeViews,
|
&ChatPage::initializeViews,
|
||||||
view_manager_,
|
view_manager_,
|
||||||
[this](const mtx::responses::Rooms &rooms) { view_manager_->initialize(rooms); });
|
[this](const mtx::responses::Rooms &rooms) { view_manager_->sync(rooms); });
|
||||||
connect(this,
|
connect(this,
|
||||||
&ChatPage::initializeEmptyViews,
|
&ChatPage::initializeEmptyViews,
|
||||||
view_manager_,
|
view_manager_,
|
||||||
@ -582,7 +582,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
|||||||
nhlog::db()->error("failed to retrieve invites: {}", e.what());
|
nhlog::db()->error("failed to retrieve invites: {}", e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
view_manager_->initialize(rooms);
|
view_manager_->sync(rooms);
|
||||||
removeLeftRooms(rooms.leave);
|
removeLeftRooms(rooms.leave);
|
||||||
|
|
||||||
bool hasNotifications = false;
|
bool hasNotifications = false;
|
||||||
|
@ -27,9 +27,10 @@ TimelineViewManager::TimelineViewManager(QWidget *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TimelineViewManager::initialize(const mtx::responses::Rooms &rooms)
|
TimelineViewManager::sync(const mtx::responses::Rooms &rooms)
|
||||||
{
|
{
|
||||||
for (auto it = rooms.join.cbegin(); it != rooms.join.cend(); ++it) {
|
for (auto it = rooms.join.cbegin(); it != rooms.join.cend(); ++it) {
|
||||||
|
// addRoom will only add the room, if it doesn't exist
|
||||||
addRoom(QString::fromStdString(it->first));
|
addRoom(QString::fromStdString(it->first));
|
||||||
models.value(QString::fromStdString(it->first))->addEvents(it->second.timeline);
|
models.value(QString::fromStdString(it->first))->addEvents(it->second.timeline);
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,9 @@ public:
|
|||||||
TimelineViewManager(QWidget *parent = 0);
|
TimelineViewManager(QWidget *parent = 0);
|
||||||
QWidget *getWidget() const { return container; }
|
QWidget *getWidget() const { return container; }
|
||||||
|
|
||||||
void initialize(const mtx::responses::Rooms &rooms);
|
void sync(const mtx::responses::Rooms &rooms);
|
||||||
void addRoom(const QString &room_id);
|
void addRoom(const QString &room_id);
|
||||||
|
|
||||||
void sync(const mtx::responses::Rooms &rooms) {}
|
|
||||||
void clearAll() { models.clear(); }
|
void clearAll() { models.clear(); }
|
||||||
|
|
||||||
Q_INVOKABLE TimelineModel *activeTimeline() const { return timeline_; }
|
Q_INVOKABLE TimelineModel *activeTimeline() const { return timeline_; }
|
||||||
|
Loading…
Reference in New Issue
Block a user