summary refs log tree commit diff
path: root/src/timeline/TimelineView.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-12-01 15:39:50 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-12-01 15:39:50 +0200
commit432a2e13548b00bbacee1f06da8e605e26006379 (patch)
treecfbbb0819dd6364a0ee11e4159a3c44b909ee7a7 /src/timeline/TimelineView.cc
parentGroup emoji and dialogs with namespaces (diff)
downloadnheko-432a2e13548b00bbacee1f06da8e605e26006379.tar.xz
Add inline audio clip player (m.audio) (#143)
Diffstat (limited to 'src/timeline/TimelineView.cc')
-rw-r--r--src/timeline/TimelineView.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/timeline/TimelineView.cc b/src/timeline/TimelineView.cc
index 8ccff85a..e5fd7f88 100644
--- a/src/timeline/TimelineView.cc
+++ b/src/timeline/TimelineView.cc
@@ -25,8 +25,10 @@
 #include "Sync.h"
 
 #include "timeline/TimelineView.h"
+#include "timeline/widgets/AudioItem.h"
 #include "timeline/widgets/FileItem.h"
 #include "timeline/widgets/ImageItem.h"
+#include "timeline/widgets/VideoItem.h"
 
 namespace events = matrix::events;
 namespace msgs   = matrix::events::messages;
@@ -229,22 +231,25 @@ TimelineView::parseMessageEvent(const QJsonObject &event, TimelineDirection dire
         if (ty == events::EventType::RoomMessage) {
                 events::MessageEventType msg_type = events::extractMessageEventType(event);
 
+                using Audio  = events::MessageEvent<msgs::Audio>;
                 using Emote  = events::MessageEvent<msgs::Emote>;
                 using File   = events::MessageEvent<msgs::File>;
                 using Image  = events::MessageEvent<msgs::Image>;
                 using Notice = events::MessageEvent<msgs::Notice>;
                 using Text   = events::MessageEvent<msgs::Text>;
 
-                if (msg_type == events::MessageEventType::Text) {
-                        return processMessageEvent<Text>(event, direction);
-                } else if (msg_type == events::MessageEventType::Notice) {
-                        return processMessageEvent<Notice>(event, direction);
-                } else if (msg_type == events::MessageEventType::Image) {
-                        return processMessageEvent<Image, ImageItem>(event, direction);
+                if (msg_type == events::MessageEventType::Audio) {
+                        return processMessageEvent<Audio, AudioItem>(event, direction);
                 } else if (msg_type == events::MessageEventType::Emote) {
                         return processMessageEvent<Emote>(event, direction);
                 } else if (msg_type == events::MessageEventType::File) {
                         return processMessageEvent<File, FileItem>(event, direction);
+                } else if (msg_type == events::MessageEventType::Image) {
+                        return processMessageEvent<Image, ImageItem>(event, direction);
+                } else if (msg_type == events::MessageEventType::Notice) {
+                        return processMessageEvent<Notice>(event, direction);
+                } else if (msg_type == events::MessageEventType::Text) {
+                        return processMessageEvent<Text>(event, direction);
                 } else if (msg_type == events::MessageEventType::Unknown) {
                         // TODO Handle redacted messages.
                         // Silenced for now.