summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/timeline/InputBar.cpp')
-rw-r--r--src/timeline/InputBar.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp

index 78416135..191160ea 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp
@@ -829,6 +829,14 @@ InputBar::reaction(const QString &reactedEvent, const QString &reactionKey) reaction.relations.relations.push_back(rel); room->sendMessageEvent(reaction, mtx::events::EventType::Reaction); + + auto recents = UserSettings::instance()->recentReactions(); + if (recents.contains(reactionKey)) + recents.removeOne(reactionKey); + else if (recents.size() >= 6) + recents.removeLast(); + recents.push_front(reactionKey); + UserSettings::instance()->setRecentReactions(recents); // Otherwise, we have previously reacted and the reaction should be redacted } else { room->redactEvent(selfReactedEvent);