summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-07-12 22:28:01 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-07-12 22:28:01 +0200
commit9d6bc706ff1a4fd035516ab04d3f762325dfff83 (patch)
tree15b4dabe50453ea3034abc5f19d726eff3efa409 /src/timeline
parentFix a few missing properties (diff)
downloadnheko-9d6bc706ff1a4fd035516ab04d3f762325dfff83.tar.xz
Don't use full dump for replies
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineModel.h5
-rw-r--r--src/timeline/TimelineViewManager.cpp2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index 46153732..a3c973d6 100644
--- a/src/timeline/TimelineModel.h
+++ b/src/timeline/TimelineModel.h
@@ -209,11 +209,16 @@ public:
                 CallType,
                 Dump,
         };
+        Q_ENUM(Roles);
 
         QHash<int, QByteArray> roleNames() const override;
         int rowCount(const QModelIndex &parent = QModelIndex()) const override;
         QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
         QVariant data(const mtx::events::collections::TimelineEvents &event, int role) const;
+        Q_INVOKABLE QVariant dataById(QString id, int role)
+        {
+                return data(index(idToIndex(id)), role);
+        }
 
         bool canFetchMore(const QModelIndex &) const override;
         void fetchMore(const QModelIndex &) override;
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index a45294d1..a6fc674e 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -178,6 +178,8 @@ TimelineViewManager::TimelineViewManager(CallManager *callManager, ChatPage *par
           0,
           "RoomSettingsModel",
           "Room Settings needs to be instantiated on the C++ side");
+        qmlRegisterUncreatableType<TimelineModel>(
+          "im.nheko", 1, 0, "Room", "Room needs to be instantiated on the C++ side");
 
         static auto self = this;
         qmlRegisterSingletonType<MainWindow>(