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)
|