@@ -828,9 +828,7 @@ public void joinConferenceRoom()
828828 // the room)
829829 inviteTimeout .scheduleTimeout ();
830830
831- this .getConnection ()
832- .addAsyncStanzaListener (this .roomConfigurationListener ,
833- new StanzaTypeFilter (org .jivesoftware .smack .packet .Message .class ));
831+ registerRoomConfigurationChange ();
834832
835833 if (StringUtils .isNullOrEmpty (roomPassword ))
836834 {
@@ -1048,10 +1046,8 @@ private void onJvbCallEnded()
10481046
10491047 private void leaveConferenceRoom ()
10501048 {
1051- if (roomConfigurationListener != null )
1052- {
1053- this .getConnection ().removeAsyncStanzaListener (this .roomConfigurationListener );
1054- }
1049+
1050+ unregisterRoomConfigurationChange ();
10551051
10561052 if (this .jitsiMeetTools != null )
10571053 {
@@ -2099,6 +2095,16 @@ private void onRoomConfigurationChanged()
20992095 {
21002096 if (this .mucRoom != null )
21012097 {
2098+ /**
2099+ * Check the room configuration only if force mute is enabled.
2100+ * This should probably be in jitsi SDK.
2101+ */
2102+
2103+ if (!this .forceMute .enabled ())
2104+ {
2105+ return ;
2106+ }
2107+
21022108 ServiceDiscoveryManager serviceDiscoveryManager
21032109 = ServiceDiscoveryManager .getInstanceFor (this .getConnection ());
21042110
@@ -2151,4 +2157,38 @@ private void onRoomConfigurationChanged()
21512157 logger .error (ex .toString ());
21522158 }
21532159 }
2160+
2161+ /**
2162+ *
2163+ */
2164+ private void registerRoomConfigurationChange ()
2165+ {
2166+ if (this .xmppProvider instanceof ProtocolProviderServiceJabberImpl )
2167+ {
2168+ XMPPConnection xmppConnection = ((ProtocolProviderServiceJabberImpl ) this .xmppProvider )
2169+ .getConnection ();
2170+
2171+ xmppConnection
2172+ .addAsyncStanzaListener (this .roomConfigurationListener ,
2173+ new StanzaTypeFilter (org .jivesoftware .smack .packet .Message .class ));
2174+ }
2175+ }
2176+
2177+ /**
2178+ *
2179+ */
2180+ private void unregisterRoomConfigurationChange ()
2181+ {
2182+ if (this .xmppProvider instanceof ProtocolProviderServiceJabberImpl )
2183+ {
2184+ if (roomConfigurationListener != null )
2185+ {
2186+ XMPPConnection xmppConnection = ((ProtocolProviderServiceJabberImpl ) this .xmppProvider )
2187+ .getConnection ();
2188+
2189+ xmppConnection
2190+ .removeAsyncStanzaListener (this .roomConfigurationListener );
2191+ }
2192+ }
2193+ }
21542194}
0 commit comments