summary refs log tree commit diff
path: root/src/timeline/ReactionsModel.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-07-19 12:22:54 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-07-19 12:22:54 +0200
commit6f2bc908badc207754ff55d543d41d9e2b847c97 (patch)
tree179012d3d482aa539462bf203651d3df04022df4 /src/timeline/ReactionsModel.h
parentClose cursor we don't need and where we overwrite the contents (diff)
downloadnheko-6f2bc908badc207754ff55d543d41d9e2b847c97.tar.xz
Fix reaction display
Diffstat (limited to 'src/timeline/ReactionsModel.h')
-rw-r--r--src/timeline/ReactionsModel.h41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/timeline/ReactionsModel.h b/src/timeline/ReactionsModel.h
deleted file mode 100644

index c839afc8..00000000 --- a/src/timeline/ReactionsModel.h +++ /dev/null
@@ -1,41 +0,0 @@ -#pragma once - -#include <QAbstractListModel> -#include <QHash> - -#include <utility> -#include <vector> - -#include <mtx/events/collections.hpp> - -class ReactionsModel : public QAbstractListModel -{ - Q_OBJECT -public: - explicit ReactionsModel(QObject *parent = nullptr) { Q_UNUSED(parent); } - enum Roles - { - Key, - Count, - Users, - SelfReactedEvent, - }; - - 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; - -public slots: - void addReaction(const std::string &room_id, - const mtx::events::RoomEvent<mtx::events::msg::Reaction> &reaction); - void removeReaction(const mtx::events::RoomEvent<mtx::events::msg::Reaction> &reaction); - -private: - struct KeyReaction - { - std::string key; - std::map<std::string, mtx::events::RoomEvent<mtx::events::msg::Reaction>> reactions; - }; - std::string room_id_; - std::vector<KeyReaction> reactions; -};