Fixed hidden participant update (#1857)
This commit is contained in:
@@ -625,14 +625,13 @@ func (p *ParticipantImpl) removeMutedTrackNotFired(mt *MediaTrack) {
|
|||||||
// AddTrack is called when client intends to publish track.
|
// AddTrack is called when client intends to publish track.
|
||||||
// records track details and lets client know it's ok to proceed
|
// records track details and lets client know it's ok to proceed
|
||||||
func (p *ParticipantImpl) AddTrack(req *livekit.AddTrackRequest) {
|
func (p *ParticipantImpl) AddTrack(req *livekit.AddTrackRequest) {
|
||||||
p.lock.Lock()
|
if !p.CanPublishSource(req.Source) {
|
||||||
defer p.lock.Unlock()
|
|
||||||
|
|
||||||
if !p.grants.Video.GetCanPublishSource(req.Source) {
|
|
||||||
p.params.Logger.Warnw("no permission to publish track", nil)
|
p.params.Logger.Warnw("no permission to publish track", nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.lock.Lock()
|
||||||
|
defer p.lock.Unlock()
|
||||||
ti := p.addPendingTrackLocked(req)
|
ti := p.addPendingTrackLocked(req)
|
||||||
if ti == nil {
|
if ti == nil {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -86,6 +86,10 @@ func (p *ParticipantImpl) SendParticipantUpdate(participantsToUpdate []*livekit.
|
|||||||
isValid = false
|
isValid = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if pi.Permission != nil && pi.Permission.Hidden && pi.Sid != string(p.params.SID) {
|
||||||
|
p.params.Logger.Debugw("skipping hidden participant update", "otherParticipant", pi.Identity)
|
||||||
|
isValid = false
|
||||||
|
}
|
||||||
if isValid {
|
if isValid {
|
||||||
p.updateCache.Add(pID, participantUpdateInfo{version: pi.Version, state: pi.State, updatedAt: time.Now()})
|
p.updateCache.Add(pID, participantUpdateInfo{version: pi.Version, state: pi.State, updatedAt: time.Now()})
|
||||||
validUpdates = append(validUpdates, pi)
|
validUpdates = append(validUpdates, pi)
|
||||||
|
|||||||
Reference in New Issue
Block a user