@@ -3170,14 +3170,53 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b
31703170
31713171 if (participant_obj.contains (" m" ) && participant_obj[" m" ].is_bool ())
31723172 {
3173- participant-> mIsModeratorMuted = participant_obj[" m" ].as_bool ();
3174- if (isSpatial () && ( gAgentID == agent_id) )
3173+ bool is_moderator_muted = participant_obj[" m" ].as_bool ();
3174+ if (isSpatial ())
31753175 {
3176- LLNearbyVoiceModeration::getInstance ()->setMutedInfo (mChannelID , participant->mIsModeratorMuted );
3176+ // ignore muted flags from non-primary server
3177+ if (mPrimary || primary)
3178+ {
3179+ participant->mIsModeratorMuted = is_moderator_muted;
3180+ if (gAgentID == agent_id)
3181+ {
3182+ LLNearbyVoiceModeration::getInstance ()->setMutedInfo (mChannelID , is_moderator_muted);
3183+ }
3184+ }
3185+ }
3186+ else
3187+ {
3188+ participant->mIsModeratorMuted = is_moderator_muted;
31773189 }
31783190 }
31793191 }
31803192 }
3193+ else
3194+ {
3195+ if (isSpatial () && (mPrimary || primary))
3196+ {
3197+ // mute info message can be received before join message, so try to mute again later
3198+ if (participant_obj.contains (" m" ) && participant_obj[" m" ].is_bool ())
3199+ {
3200+ bool is_moderator_muted = participant_obj[" m" ].as_bool ();
3201+ std::string channel_id = mChannelID ;
3202+ F32 delay { 1 .5f };
3203+ doAfterInterval (
3204+ [channel_id, agent_id, is_moderator_muted]()
3205+ {
3206+ LLWebRTCVoiceClient::participantStatePtr_t participant =
3207+ LLWebRTCVoiceClient::getInstance ()->findParticipantByID (channel_id, agent_id);
3208+ if (participant)
3209+ {
3210+ participant->mIsModeratorMuted = is_moderator_muted;
3211+ if (gAgentID == agent_id)
3212+ {
3213+ LLNearbyVoiceModeration::getInstance ()->setMutedInfo (channel_id, is_moderator_muted);
3214+ }
3215+ }
3216+ }, delay);
3217+ }
3218+ }
3219+ }
31813220 }
31823221 // tell the simulator to set the mute and volume data for this
31833222 // participant, if there are any updates.
0 commit comments