@@ -837,9 +837,7 @@ public void joinConferenceRoom()
837837 // the room)
838838 inviteTimeout .scheduleTimeout ();
839839
840- this .getConnection ()
841- .addAsyncStanzaListener (this .roomConfigurationListener ,
842- new StanzaTypeFilter (org .jivesoftware .smack .packet .Message .class ));
840+ registerRoomConfigurationChange ();
843841
844842 if (StringUtils .isNullOrEmpty (roomPassword ))
845843 {
@@ -1057,10 +1055,8 @@ private void onJvbCallEnded()
10571055
10581056 private void leaveConferenceRoom ()
10591057 {
1060- if (roomConfigurationListener != null )
1061- {
1062- this .getConnection ().removeAsyncStanzaListener (this .roomConfigurationListener );
1063- }
1058+
1059+ unregisterRoomConfigurationChange ();
10641060
10651061 if (this .jitsiMeetTools != null )
10661062 {
@@ -2141,9 +2137,22 @@ private void onAllowedToUnmute()
21412137 /**
21422138 * Called when room configuration has changed.
21432139 */
2144- private void onRoomConfigurationChanged () {
2145- try {
2146- if (this .mucRoom != null ) {
2140+ private void onRoomConfigurationChanged ()
2141+ {
2142+ try
2143+ {
2144+ if (this .mucRoom != null )
2145+ {
2146+ /**
2147+ * Check the room configuration only if force mute is enabled.
2148+ * This should probably be in jitsi SDK.
2149+ */
2150+
2151+ if (!this .forceMute .enabled ())
2152+ {
2153+ return ;
2154+ }
2155+
21472156 ServiceDiscoveryManager serviceDiscoveryManager
21482157 = ServiceDiscoveryManager .getInstanceFor (this .getConnection ());
21492158
@@ -2187,5 +2196,39 @@ private void onRoomConfigurationChanged() {
21872196 logger .error (ex .toString ());
21882197 }
21892198 }
2199+
2200+ /**
2201+ *
2202+ */
2203+ private void registerRoomConfigurationChange ()
2204+ {
2205+ if (this .xmppProvider instanceof ProtocolProviderServiceJabberImpl )
2206+ {
2207+ XMPPConnection xmppConnection = ((ProtocolProviderServiceJabberImpl ) this .xmppProvider )
2208+ .getConnection ();
2209+
2210+ xmppConnection
2211+ .addAsyncStanzaListener (this .roomConfigurationListener ,
2212+ new StanzaTypeFilter (org .jivesoftware .smack .packet .Message .class ));
2213+ }
2214+ }
2215+
2216+ /**
2217+ *
2218+ */
2219+ private void unregisterRoomConfigurationChange ()
2220+ {
2221+ if (this .xmppProvider instanceof ProtocolProviderServiceJabberImpl )
2222+ {
2223+ if (roomConfigurationListener != null )
2224+ {
2225+ XMPPConnection xmppConnection = ((ProtocolProviderServiceJabberImpl ) this .xmppProvider )
2226+ .getConnection ();
2227+
2228+ xmppConnection
2229+ .removeAsyncStanzaListener (this .roomConfigurationListener );
2230+ }
2231+ }
2232+ }
21902233}
21912234
0 commit comments