aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-03-13 18:53:42 +0300
committerlink2xt <link2xt@testrun.org>2021-03-13 19:18:04 +0300
commite8633b7a13de9fcb56ee29a9fc36d5520c2514a9 (patch)
tree84b0f696a31934f40532acbabb7013137bb2ee00
parent7f2395c2a4a57df5ff36231904be0a4464c53126 (diff)
downloadkdeltachat-e8633b7a13de9fcb56ee29a9fc36d5520c2514a9.tar.gz
kdeltachat-e8633b7a13de9fcb56ee29a9fc36d5520c2514a9.zip
Add support for audio and voice messages
-rw-r--r--qml/Message.qml24
1 files changed, 23 insertions, 1 deletions
diff --git a/qml/Message.qml b/qml/Message.qml
index a217bc8..9134a72 100644
--- a/qml/Message.qml
+++ b/qml/Message.qml
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQml.Models 2.1
import QtQuick.Dialogs 1.1
+import QtMultimedia 5.8
import org.kde.kirigami 2.12 as Kirigami
import DeltaChat 1.0
@@ -46,6 +47,26 @@ RowLayout {
}
Component {
+ id: audioMessageView
+
+ ColumnLayout {
+ MediaPlayer {
+ id: player
+ source: Qt.resolvedUrl("file:" + messageObject.message.file)
+ }
+ Label {
+ font.bold: true
+ text: "Audio"
+ textFormat: Text.PlainText
+ }
+ Button {
+ text: "play"
+ onPressed: player.play()
+ }
+ }
+ }
+
+ Component {
id: textMessageView
Label {
@@ -99,7 +120,8 @@ RowLayout {
Loader {
- sourceComponent: messageObject.message.viewtype == 20 ? imageMessageView : textMessageView
+ sourceComponent: [20, 21, 23].includes(messageObject.message.viewtype) ? imageMessageView
+ : [40, 41].includes(messageObject.message.viewtype) ? audioMessageView : textMessageView
}
TextEdit {