davidliu
Committed by GitHub

Don't apply server mute from updateFromInfo (#148)

Protocol 3 remote mute has server sending explicit mute message for this purpose.
@@ -464,11 +464,12 @@ internal constructor( @@ -464,11 +464,12 @@ internal constructor(
464 override fun updateFromInfo(info: LivekitModels.ParticipantInfo) { 464 override fun updateFromInfo(info: LivekitModels.ParticipantInfo) {
465 super.updateFromInfo(info) 465 super.updateFromInfo(info)
466 466
467 - // detect tracks that have been muted on the server side, apply those changes 467 + // detect tracks that have mute status mismatched on server
468 for (ti in info.tracksList) { 468 for (ti in info.tracksList) {
469 val publication = this.tracks[ti.sid] as? LocalTrackPublication ?: continue 469 val publication = this.tracks[ti.sid] as? LocalTrackPublication ?: continue
470 - if (ti.muted != publication.muted) {  
471 - publication.muted = ti.muted 470 + val localMuted = publication.muted
  471 + if (ti.muted != localMuted) {
  472 + engine.updateMuteStatus(sid, localMuted)
472 } 473 }
473 } 474 }
474 } 475 }