summary refs log tree commit diff
path: root/src/timeline/TimelineViewManager.cpp
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2020-05-21 21:21:35 -0400
committerJoseph Donofry <joedonofry@gmail.com>2020-05-21 21:21:35 -0400
commit5228861b88076dc6bd8eaf46fa8c9b23cb5c2c3b (patch)
tree8097a760b05b1f93451e32e9c0e1e175665f8991 /src/timeline/TimelineViewManager.cpp
parentMerge origin/master into reactions (diff)
downloadnheko-5228861b88076dc6bd8eaf46fa8c9b23cb5c2c3b.tar.xz
Add reaction/redaction for in-line Reactions
Diffstat (limited to 'src/timeline/TimelineViewManager.cpp')
-rw-r--r--src/timeline/TimelineViewManager.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp

index 3f8a5b76..0375ccc8 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp
@@ -291,6 +291,22 @@ TimelineViewManager::queueEmoteMessage(const QString &msg) } void +TimelineViewManager::reactToMessage(const QString &roomId, + const QString &reactedEvent, + const QString &reactionKey, + const QString &selfReactedEvent) +{ + // If selfReactedEvent is empty, that means we haven't previously reacted + if (selfReactedEvent.isEmpty()) { + queueReactionMessage(roomId, reactedEvent, reactionKey); + // Otherwise, we have previously reacted and the reaction should be redacted + } else { + auto model = models.value(roomId); + model->redactEvent(selfReactedEvent); + } +} + +void TimelineViewManager::queueReactionMessage(const QString &roomId, const QString &reactedEvent, const QString &reactionKey)