Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-10-10 17:41:24 +0300
committerGitHub <noreply@github.com>2022-10-10 17:41:24 +0300
commit4e9d58db27843d90f1b8ef4f2d5a102fc218450d (patch)
treecb7ddef9daeb16eab1ff5acb515558985ea0e8de
parent278061c07a5d0a643a9990b98918d6328dcbf441 (diff)
parent13c05499451ee8b3a94a96624503fdca236cba36 (diff)
Merge pull request #8139 from nextcloud/backport/8138/stable25
[stable25] Fix silent call
-rw-r--r--src/utils/signaling.js3
-rw-r--r--src/utils/webrtc/index.js14
2 files changed, 11 insertions, 6 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js
index 31e8ecb56..ed09af429 100644
--- a/src/utils/signaling.js
+++ b/src/utils/signaling.js
@@ -264,12 +264,13 @@ Signaling.Base.prototype._joinCallSuccess = function(/* token */) {
// Override in subclasses if necessary.
}
-Signaling.Base.prototype.joinCall = function(token, flags) {
+Signaling.Base.prototype.joinCall = function(token, flags, silent) {
return new Promise((resolve, reject) => {
this._trigger('beforeJoinCall', [token])
axios.post(generateOcsUrl('apps/spreed/api/v4/call/{token}', { token }), {
flags,
+ silent,
})
.then(function() {
this.currentCallToken = token
diff --git a/src/utils/webrtc/index.js b/src/utils/webrtc/index.js
index 2f2db261f..8be650f76 100644
--- a/src/utils/webrtc/index.js
+++ b/src/utils/webrtc/index.js
@@ -119,8 +119,10 @@ let failedToStartCall = null
/**
* @param {object} signaling The signaling object
* @param {object} configuration Media to connect with
+ * @param {boolean} silent Whether the call should trigger a notifications and
+ * sound for other participants or not
*/
-function startCall(signaling, configuration) {
+function startCall(signaling, configuration, silent) {
let flags = PARTICIPANT.CALL_FLAG.IN_CALL
if (configuration) {
if (configuration.audio) {
@@ -131,7 +133,7 @@ function startCall(signaling, configuration) {
}
}
- signaling.joinCall(pendingJoinCallToken, flags).then(() => {
+ signaling.joinCall(pendingJoinCallToken, flags, silent).then(() => {
startedCall(flags)
}).catch(error => {
failedToStartCall(error)
@@ -170,10 +172,12 @@ async function signalingJoinConversation(token, sessionId) {
*
* @param {string} token Conversation to join the call
* @param {number} flags Bitwise combination of PARTICIPANT.CALL_FLAG
+ * @param {boolean} silent Whether the call should trigger a notifications and
+ * sound for other participants or not
* @return {Promise<void>} Resolved with the actual flags based on the
* available media
*/
-async function signalingJoinCall(token, flags) {
+async function signalingJoinCall(token, flags, silent) {
if (tokensInSignaling[token]) {
pendingJoinCallToken = token
@@ -219,13 +223,13 @@ async function signalingJoinCall(token, flags) {
webRtc.off('localMediaStarted', startCallOnceLocalMediaStarted)
webRtc.off('localMediaError', startCallOnceLocalMediaError)
- startCall(_signaling, configuration)
+ startCall(_signaling, configuration, silent)
}
const startCallOnceLocalMediaError = () => {
webRtc.off('localMediaStarted', startCallOnceLocalMediaStarted)
webRtc.off('localMediaError', startCallOnceLocalMediaError)
- startCall(_signaling, null)
+ startCall(_signaling, null, silent)
}
// ".once" can not be used, as both handlers need to be removed when