summary refs log tree commit diff
path: root/src/timeline/TimelineViewManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/timeline/TimelineViewManager.h')
-rw-r--r--src/timeline/TimelineViewManager.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 0665b663..f4297243 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -22,6 +22,7 @@
 #include "WebRTCSession.h"
 #include "emoji/EmojiModel.h"
 #include "emoji/Provider.h"
+#include "timeline/RoomlistModel.h"
 
 class MxcImageProvider;
 class BlurhashProvider;
@@ -48,13 +49,15 @@ public:
         QWidget *getWidget() const { return container; }
 
         void sync(const mtx::responses::Rooms &rooms);
-        void addRoom(const QString &room_id);
+
+        MxcImageProvider *imageProvider() { return imgProvider; }
+        CallManager *callManager() { return callManager_; }
 
         void clearAll()
         {
                 timeline_ = nullptr;
                 emit activeTimelineChanged(nullptr);
-                models.clear();
+                rooms->clear();
         }
 
         Q_INVOKABLE TimelineModel *activeTimeline() const { return timeline_; }
@@ -109,11 +112,7 @@ public slots:
         void focusTimeline();
         TimelineModel *getHistoryView(const QString &room_id)
         {
-                auto room = models.find(room_id);
-                if (room != models.end())
-                        return room.value().data();
-                else
-                        return nullptr;
+                return rooms->getRoomById(room_id).get();
         }
 
         void updateColorPalette();
@@ -126,7 +125,6 @@ public slots:
         void queueCallMessage(const QString &roomid, const mtx::events::msg::CallAnswer &);
         void queueCallMessage(const QString &roomid, const mtx::events::msg::CallHangUp &);
 
-        void updateEncryptedDescriptions();
         void setVideoCallItem();
 
         void enableBackButton()
@@ -163,7 +161,6 @@ private:
         ColorImageProvider *colorImgProvider;
         BlurhashProvider *blurhashProvider;
 
-        QHash<QString, QSharedPointer<TimelineModel>> models;
         TimelineModel *timeline_  = nullptr;
         CallManager *callManager_ = nullptr;
 
@@ -171,6 +168,8 @@ private:
         bool isNarrowView_    = false;
         bool isWindowFocused_ = false;
 
+        RoomlistModel *rooms = nullptr;
+
         QHash<QString, QColor> userColors;
 
         QHash<QString, QSharedPointer<DeviceVerificationFlow>> dvList;