Skip to content

Commit 5b16e73

Browse files
committed
Auto hide audio recorder when wav uploads are not white listed
1 parent a4bea06 commit 5b16e73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

client/views/app/room.coffee

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ Template.room.helpers
188188
return !! ChatRoom.findOne { _id: @_id, t: 'c' }
189189

190190
canRecordAudio: ->
191-
return RocketChat.settings.get('Message_AudioRecorderEnabled') and (navigator.getUserMedia? or navigator.webkitGetUserMedia?)
191+
wavRegex = /audio\/wav|audio\/\*/i
192+
wavEnabled = RocketChat.settings.get("FileUpload_MediaTypeWhiteList").match(wavRegex)
193+
return RocketChat.settings.get('Message_AudioRecorderEnabled') and (navigator.getUserMedia? or navigator.webkitGetUserMedia?) and wavEnabled
192194

193195
unreadSince: ->
194196
room = ChatRoom.findOne(this._id, { reactive: false })

0 commit comments

Comments
 (0)