From 19f27236ea82b1927c83e4e24c71b30061674ee7 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Mon, 20 Jul 2020 00:42:48 +0200 Subject: Fix reactions --- src/timeline/TimelineModel.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/timeline/TimelineModel.h') 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()); + return vec; + } + void updateLastMessage(); void addEvents(const mtx::responses::Timeline &events); template -- cgit 1.5.1