summary refs log tree commit diff
path: root/src/timeline/TimelineModel.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-07-20 00:42:48 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-07-20 00:42:48 +0200
commit19f27236ea82b1927c83e4e24c71b30061674ee7 (patch)
tree1f6449488bbbd4dc23827253bbf56096f8f949e7 /src/timeline/TimelineModel.h
parentFix reaction display (diff)
downloadnheko-19f27236ea82b1927c83e4e24c71b30061674ee7.tar.xz
Fix reactions
Diffstat (limited to 'src/timeline/TimelineModel.h')
-rw-r--r--src/timeline/TimelineModel.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index cbe88fd2..f8a84f17 100644
--- a/src/timeline/TimelineModel.h
+++ b/src/timeline/TimelineModel.h
@@ -197,6 +197,15 @@ public:
         Q_INVOKABLE void cacheMedia(QString eventId);
         Q_INVOKABLE bool saveMedia(QString eventId) const;
 
+        std::vector<::Reaction> reactions(const std::string &event_id)
+        {
+                auto list = events.reactions(event_id);
+                std::vector<::Reaction> vec;
+                for (const auto &r : list)
+                        vec.push_back(r.value<Reaction>());
+                return vec;
+        }
+
         void updateLastMessage();
         void addEvents(const mtx::responses::Timeline &events);
         template<class T>