2020 */
2121
2222import 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'
2526import { fetchSignalingSettings } from '../../services/signalingService.js'
2627import store from '../../store/index.js'
2728import 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
5254let cancelFetchSignalingSettings = null
5355let 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 */
451453function signalingSetTyping ( typing ) {
452- signalingTypingHandler . setTyping ( typing )
454+ signalingTypingHandler ? .setTyping ( typing )
453455}
454456
455457export {
0 commit comments