From 70456ef93d588dea00f55aeff91a48d65a814e26 Mon Sep 17 00:00:00 2001
From: Mario Jr <mariogasparoni@gmail.com>
Date: Wed, 18 Nov 2020 11:55:32 -0300
Subject: [PATCH] Set listenOnly to false when user left voice

The message/event UserLeftVoiceConfToClientEvtMsg is used when user leaves mic and listenonly, but it only sets to false the 'voiceJoined' (which represents the <hasVoiceVoiceJoined> property in BBB's XML API.
We now also set to false the 'listeningOnly' (which represents the <isListeningOnly> property in BBB's XML API). Setting both to false is not a problem, once 'MIC' and 'ListenOnly' states are mutually exclusives
Fixes #10852
---
 .../src/main/java/org/bigbluebutton/api/MeetingService.java  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java
index e5d4cdad2c..d2a3ee7ad7 100755
--- a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java
+++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java
@@ -919,6 +919,11 @@ public class MeetingService implements MessageListener {
           User vuser = m.userLeft(message.userId);
         } else {
           user.setVoiceJoined(false);
+          // userLeftVoice is also used when user leaves Global (listenonly)
+          // audio. Also tetting listenOnly to false is not a problem,
+          // once user can't join both voice/mic and global/listenonly
+          // at the same time.
+          user.setListeningOnly(false);
         }
       }
     }
-- 
GitLab