summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-10-09 22:50:41 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-10-09 22:50:41 +0200
commit149535efbe5ced135ae16821f97332fb8972c3c5 (patch)
treeeb854f8da8cc947c8ed31bd48455ba6fe70e64c5
parentAdd threads display and prettier highlight to bubbles style (diff)
downloadnheko-149535efbe5ced135ae16821f97332fb8972c3c5.tar.xz
Make effect messages stand out more
-rw-r--r--resources/qml/ui/TimelineEffects.qml3
-rw-r--r--src/timeline/TimelineModel.cpp10
2 files changed, 11 insertions, 2 deletions
diff --git a/resources/qml/ui/TimelineEffects.qml b/resources/qml/ui/TimelineEffects.qml
index 4e2acea4..35c54c04 100644
--- a/resources/qml/ui/TimelineEffects.qml
+++ b/resources/qml/ui/TimelineEffects.qml
@@ -24,7 +24,7 @@ Item {
     ParticleSystem {
         id: particleSystem
 
-        Component.onCompleted: pause();
+        Component.onCompleted: stop();
         paused: !effectRoot.shouldEffectsRun
         running: effectRoot.shouldEffectsRun
     }
@@ -32,7 +32,6 @@ Item {
     Emitter {
         id: confettiEmitter
 
-        Component.onCompleted: stop();
         group: "confetti"
         width: effectRoot.width * 3/4
         enabled: false
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index aa7a5e6a..e8b5d40e 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -690,6 +690,16 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r
             formattedBody_.replace(curImg, imgReplacement);
         }
 
+        if (auto effectMessage =
+              std::get_if<mtx::events::RoomEvent<mtx::events::msg::ElementEffect>>(&event)) {
+            if (effectMessage->content.msgtype == std::string_view("nic.custom.confetti")) {
+                formattedBody_.append(QUtf8StringView(u8"🎊"));
+            } else if (effectMessage->content.msgtype ==
+                       std::string_view("io.element.effect.rainfall")) {
+                formattedBody_.append(QUtf8StringView(u8"🌧️"));
+            }
+        }
+
         return QVariant(utils::replaceEmoji(utils::linkifyMessage(formattedBody_)));
     }
     case FormattedStateEvent: {