summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-08-28 00:38:33 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-08-29 16:32:22 +0200
commit09c041c8ac40d2d3608c7224614fde69e1e4f08b (patch)
treeb606a260d7f22a703684e186a0af9d8215be734d /src/timeline
parentRemove CC-BY as main project license (diff)
downloadnheko-09c041c8ac40d2d3608c7224614fde69e1e4f08b.tar.xz
Use in memory media player instead of storing unencrypted files on disk
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineModel.h9
-rw-r--r--src/timeline/TimelineViewManager.cpp2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index e3ca8811..417fbb7f 100644
--- a/src/timeline/TimelineModel.h
+++ b/src/timeline/TimelineModel.h
@@ -293,6 +293,15 @@ public:
         crypto::Trust trustlevel() const;
         int roomMemberCount() const;
 
+        std::optional<mtx::events::collections::TimelineEvents> eventById(const QString &id)
+        {
+                auto e = events.get(id.toStdString(), "");
+                if (e)
+                        return *e;
+                else
+                        return std::nullopt;
+        }
+
 public slots:
         void setCurrentIndex(int index);
         int currentIndex() const { return idToIndex(currentId); }
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index 97b60b0c..f42ec02f 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -35,6 +35,7 @@
 #include "dialogs/ImageOverlay.h"
 #include "emoji/EmojiModel.h"
 #include "emoji/Provider.h"
+#include "ui/MxcMediaProxy.h"
 #include "ui/NhekoCursorShape.h"
 #include "ui/NhekoDropArea.h"
 #include "ui/NhekoGlobalObject.h"
@@ -176,6 +177,7 @@ TimelineViewManager::TimelineViewManager(CallManager *callManager, ChatPage *par
         qmlRegisterType<DelegateChooser>("im.nheko", 1, 0, "DelegateChooser");
         qmlRegisterType<NhekoDropArea>("im.nheko", 1, 0, "NhekoDropArea");
         qmlRegisterType<NhekoCursorShape>("im.nheko", 1, 0, "CursorShape");
+        qmlRegisterType<MxcMediaProxy>("im.nheko", 1, 0, "MxcMedia");
         qmlRegisterUncreatableType<DeviceVerificationFlow>(
           "im.nheko", 1, 0, "DeviceVerificationFlow", "Can't create verification flow from QML!");
         qmlRegisterUncreatableType<UserProfile>(