@@ -25,7 +25,7 @@ let devMode = false
2525let selfMute = false
2626let isConnected = false
2727let webViewSession = null
28- let isTalking = false
28+ // let isTalking = false
2929let muteTimeout = null
3030let configObj
3131let micPermissionGranted = false
@@ -44,12 +44,12 @@ if (process.argv.length === 3) {
4444}
4545
4646function unmuteMic ( ) {
47- if ( selfMute === false ) {
48- isTalking = true
47+ // if ( selfMute === false){
48+ // isTalking = true
4949 console . log ( "Talking" )
5050 mainWindow . webContents . send ( 'micOpen' , 'mic-open' )
5151 mainWindow . setTitle ( "MIC OPEN" )
52- }
52+ // }
5353}
5454
5555function muteMic ( ) {
@@ -196,10 +196,11 @@ function setPTTKey() {
196196
197197 ioHook . on ( pttDisable , event => {
198198 if ( event [ pttWatch ] == configObj . key ) {
199- if ( isTalking === true ) {
200- isTalking = false
199+ console . log ( "PTT pushed down" )
200+ //if (isTalking === true) {
201+ //isTalking = false
201202 muteTimeout = setTimeout ( ( ) => muteMic ( ) , configObj . delay )
202- }
203+ // }
203204 }
204205 } )
205206
@@ -290,7 +291,7 @@ app.on('ready', () => {
290291 webViewSession . setPermissionRequestHandler ( ( webContents , permission , callback ) => { // deny all permissions
291292 const url = webContents . getURL ( )
292293 if ( url . startsWith ( 'https://discord.com/' ) ) {
293- if ( permission === 'media' && isConnected === true ) { // if user is connected to Discord voice then enable microphone
294+ if ( permission === 'media' ) { // if user is connected to Discord voice then enable microphone
294295 console . log ( "User connected to Discord VOIP server. Granted permission for microphone" )
295296 micPermissionGranted = true
296297 return callback ( true )
@@ -333,10 +334,10 @@ ipcMain.on('asynchronous-message', (event, _data) => {
333334 }
334335
335336 if ( msg === 'confirmMicClose' ) {
336- if ( isTalking === true ) {
337- console . log ( "Mic state desync. Opening Mic." )
337+ // if (isTalking === true) {
338+ // console.log("Mic state desync. Opening Mic.")
338339 unmuteMic ( )
339- }
340+ // }
340341 }
341342
342343 if ( msg === 'blockUpdate' ) {
0 commit comments