summary refs log tree commit diff
path: root/resources/qml/dialogs
diff options
context:
space:
mode:
authorRohit Sutradhar <rohitsutradhar311@gmail.com>2022-10-14 19:19:05 +0530
committerGitHub <noreply@github.com>2022-10-14 13:49:05 +0000
commitac48c332867e773e0e0eb9ad0139b7b625e26851 (patch)
tree9f4799c650889bb770f72e127441426c9ae42a07 /resources/qml/dialogs
parentAdd toggle to disable decrypting notifications (diff)
downloadnheko-ac48c332867e773e0e0eb9ad0139b7b625e26851.tar.xz
VoIP v1 implementation (#1161)
* Initial commit for VoIP v1 implementation

* Added draft of event handlers for voip methods

* Added event handlers for VoIP events, added rejectCall, added version tracking for call version for V0 and V1 compatibility

* Added call events to the general message pipeline. Modified Call Reject mechanism

* Added message delegates for new events. Modified hidden events. Updated handle events.

* Updated implementation to keep track of calls on other devices

* Fixed linting

* Fixed code warnings

* Fixed minor bugs

* fixed ci

* Added acceptNegotiation method definition when missing gstreamer

* Fixed warnings

* Fixed linting
Diffstat (limited to 'resources/qml/dialogs')
-rw-r--r--resources/qml/dialogs/LeaveRoomDialog.qml12
1 files changed, 11 insertions, 1 deletions
diff --git a/resources/qml/dialogs/LeaveRoomDialog.qml b/resources/qml/dialogs/LeaveRoomDialog.qml
index d64b2d31..cb15a74d 100644
--- a/resources/qml/dialogs/LeaveRoomDialog.qml
+++ b/resources/qml/dialogs/LeaveRoomDialog.qml
@@ -7,6 +7,7 @@ import Qt.labs.platform 1.1 as P
 import QtQuick 2.15
 import QtQuick.Controls 2.15
 import im.nheko 1.0
+import "../voip"
 
 P.MessageDialog {
     id: leaveRoomRoot
@@ -18,5 +19,14 @@ P.MessageDialog {
     text: qsTr("Are you sure you want to leave?")
     modality: Qt.ApplicationModal
     buttons: P.MessageDialog.Ok | P.MessageDialog.Cancel
-    onAccepted: Rooms.leave(roomId, reason)
+    onAccepted: {
+
+        if (CallManager.haveCallInvite) {
+            callManager.rejectInvite();
+        } else if (CallManager.isOnCall) {
+            CallManager.hangUp();
+        }
+        Rooms.leave(roomId, reason)
+    }
+        
 }