Skip to content

Commit 1509a36

Browse files
committed
Enable typing signaling messages only when allowed by privacy settings
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
1 parent 778add5 commit 1509a36

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/utils/webrtc/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
*/
2121

2222
import Axios from '@nextcloud/axios'
23+
import { getCapabilities } from '@nextcloud/capabilities'
2324

24-
import { PARTICIPANT, VIRTUAL_BACKGROUND } from '../../constants.js'
25+
import { PARTICIPANT, PRIVACY, VIRTUAL_BACKGROUND } from '../../constants.js'
2526
import { fetchSignalingSettings } from '../../services/signalingService.js'
2627
import store from '../../store/index.js'
2728
import CancelableRequest from '../cancelableRequest.js'
@@ -47,7 +48,8 @@ let sentVideoQualityThrottler = null
4748

4849
// This does not really belongs here, as it is unrelated to WebRTC, but it is
4950
// included here for the time being until signaling and WebRTC are split.
50-
const signalingTypingHandler = new SignalingTypingHandler(store)
51+
const enableTypingIndicators = getCapabilities()?.spreed?.config?.chat?.['typing-privacy'] === PRIVACY.PUBLIC
52+
const signalingTypingHandler = enableTypingIndicators ? new SignalingTypingHandler(store) : null
5153

5254
let cancelFetchSignalingSettings = null
5355
let signaling = null
@@ -132,7 +134,7 @@ async function connectSignaling(token) {
132134
signaling.settings = settings
133135
})
134136

135-
signalingTypingHandler.setSignaling(signaling)
137+
signalingTypingHandler?.setSignaling(signaling)
136138
}
137139

138140
tokensInSignaling[token] = true
@@ -449,7 +451,7 @@ function signalingKill() {
449451
* @param {boolean} typing whether the current participant is typing.
450452
*/
451453
function signalingSetTyping(typing) {
452-
signalingTypingHandler.setTyping(typing)
454+
signalingTypingHandler?.setTyping(typing)
453455
}
454456

455457
export {

0 commit comments

Comments
 (0)