summary refs log tree commit diff
path: root/src/timeline/EventStore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/timeline/EventStore.cpp')
-rw-r--r--src/timeline/EventStore.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp
index 5cdb372a..d373cf55 100644
--- a/src/timeline/EventStore.cpp
+++ b/src/timeline/EventStore.cpp
@@ -15,11 +15,9 @@
 #include "EventAccessors.h"
 #include "Logging.h"
 #include "MatrixClient.h"
-#include "TimelineModel.h"
 #include "UserSettingsPage.h"
 #include "Utils.h"
 
-Q_DECLARE_METATYPE(Reaction)
 
 QCache<EventStore::IdIndex, olm::DecryptionResult> EventStore::decryptedEvents_{1000};
 QCache<EventStore::IdIndex, mtx::events::collections::TimelineEvents> EventStore::events_by_id_{
@@ -29,8 +27,6 @@ QCache<EventStore::Index, mtx::events::collections::TimelineEvents> EventStore::
 EventStore::EventStore(std::string room_id, QObject *)
   : room_id_(std::move(room_id))
 {
-    static auto reactionType = qRegisterMetaType<Reaction>();
-    (void)reactionType;
 
     auto range = cache::client()->getTimelineRange(room_id_);
 
@@ -293,12 +289,12 @@ EventStore::EventStore(std::string room_id, QObject *)
 }
 
 void
-EventStore::addPending(mtx::events::collections::TimelineEvents event)
+EventStore::addPending(const mtx::events::collections::TimelineEvents& event)
 {
     if (this->thread() != QThread::currentThread())
         nhlog::db()->warn("{} called from a different thread!", __func__);
 
-    cache::client()->savePendingMessage(this->room_id_, {event});
+    cache::client()->savePendingMessage(this->room_id_, event);
     mtx::responses::Timeline events;
     events.limited = false;
     events.events.emplace_back(event);
@@ -761,11 +757,11 @@ EventStore::decryptEvent(const IdIndex &idx,
 }
 
 void
-EventStore::refetchOnlineKeyBackupKeys(TimelineModel *room)
+EventStore::refetchOnlineKeyBackupKeys()
 {
-    for (const auto &[session_id, request] : room->events.pending_key_requests) {
+    for (const auto &[session_id, request] : this->pending_key_requests) {
         (void)request;
-        olm::lookup_keybackup(room->events.room_id_, session_id);
+        olm::lookup_keybackup(this->room_id_, session_id);
     }
 }