Support voice calls
9 files changed, 68 insertions, 0 deletions
diff --git a/resources/langs/nheko_en.ts b/resources/langs/nheko_en.ts
index db24f1fe..27d739f2 100644
--- a/resources/langs/nheko_en.ts
+++ b/resources/langs/nheko_en.ts
@@ -404,6 +404,21 @@ Example: https://server.my:8787</translation>
<source>%1 created and configured room: %2</source>
<translation>%1 created and configured room: %2</translation>
</message>
+ <message>
+ <location line="+6"/>
+ <source>%1 placed a voice call.</source>
+ <translation>%1 placed a voice call.</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>%1 answered the call.</source>
+ <translation>%1 answered the call.</translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>%1 ended the call.</source>
+ <translation>%1 ended the call.</translation>
+ </message>
</context>
<context>
<name>Placeholder</name>
@@ -1796,6 +1811,36 @@ Media size: %2
<source>%1 sent an encrypted message</source>
<translation>%1 sent an encrypted message</translation>
</message>
+ <message>
+ <location line="+5"/>
+ <source>You placed a call</source>
+ <translation>You placed a call</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>%1 placed a call</source>
+ <translation>%1 placed a call</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>You answered a call</source>
+ <translation>You answered a call</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>%1 answered a call</source>
+ <translation>%1 answered a call</translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>You ended a call</source>
+ <translation>You ended a call</translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>%1 ended a call</source>
+ <translation>%1 ended a call</translation>
+ </message>
</context>
<context>
<name>popups::UserMentions</name>
diff --git a/resources/media/callend.mp3 b/resources/media/callend.mp3
new file mode 100644
index 00000000..50c34e56
--- /dev/null
+++ b/resources/media/callend.mp3
Binary files differdiff --git a/resources/media/callend.ogg b/resources/media/callend.ogg
new file mode 100644
index 00000000..927ce1f6
--- /dev/null
+++ b/resources/media/callend.ogg
Binary files differdiff --git a/resources/media/ring.mp3 b/resources/media/ring.mp3
new file mode 100644
index 00000000..36200cd8
--- /dev/null
+++ b/resources/media/ring.mp3
Binary files differdiff --git a/resources/media/ring.ogg b/resources/media/ring.ogg
new file mode 100644
index 00000000..708213bf
--- /dev/null
+++ b/resources/media/ring.ogg
Binary files differdiff --git a/resources/media/ringback.mp3 b/resources/media/ringback.mp3
new file mode 100644
index 00000000..6ee34bf3
--- /dev/null
+++ b/resources/media/ringback.mp3
Binary files differdiff --git a/resources/media/ringback.ogg b/resources/media/ringback.ogg
new file mode 100644
index 00000000..7dbfdcd0
--- /dev/null
+++ b/resources/media/ringback.ogg
Binary files differdiff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml
index 17fe7360..52e628be 100644
--- a/resources/qml/delegates/MessageDelegate.qml
+++ b/resources/qml/delegates/MessageDelegate.qml
@@ -91,6 +91,24 @@ Item {
}
}
DelegateChoice {
+ roleValue: MtxEvent.CallInvite
+ NoticeMessage {
+ text: qsTr("%1 placed a voice call.").arg(model.data.userName)
+ }
+ }
+ DelegateChoice {
+ roleValue: MtxEvent.CallAnswer
+ NoticeMessage {
+ text: qsTr("%1 answered the call.").arg(model.data.userName)
+ }
+ }
+ DelegateChoice {
+ roleValue: MtxEvent.CallHangUp
+ NoticeMessage {
+ text: qsTr("%1 ended the call.").arg(model.data.userName)
+ }
+ }
+ DelegateChoice {
// TODO: make a more complex formatter for the power levels.
roleValue: MtxEvent.PowerLevels
NoticeMessage {
diff --git a/resources/res.qrc b/resources/res.qrc
index 439ed97b..3fd3fc96 100644
--- a/resources/res.qrc
+++ b/resources/res.qrc
@@ -136,4 +136,9 @@
<file>qml/delegates/Placeholder.qml</file>
<file>qml/delegates/Reply.qml</file>
</qresource>
+ <qresource prefix="/media">
+ <file>media/ring.ogg</file>
+ <file>media/ringback.ogg</file>
+ <file>media/callend.ogg</file>
+ </qresource>
</RCC>
|