mirror of
https://github.com/livekit/livekit.git
synced 2026-05-04 22:35:32 +00:00
Broadcast attributes update. (#2825)
This commit is contained in:
@@ -461,6 +461,9 @@ func (p *ParticipantImpl) SetMetadata(metadata string) {
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) SetAttributes(attrs map[string]string) error {
|
||||
if len(attrs) == 0 {
|
||||
return nil
|
||||
}
|
||||
p.lock.Lock()
|
||||
grants := p.grants.Load().Clone()
|
||||
if grants.Attributes == nil {
|
||||
@@ -491,6 +494,7 @@ func (p *ParticipantImpl) SetAttributes(attrs map[string]string) error {
|
||||
}
|
||||
|
||||
p.grants.Store(grants)
|
||||
p.requireBroadcast = true // already checked above
|
||||
p.dirty.Store(true)
|
||||
|
||||
onParticipantUpdate := p.onParticipantUpdate
|
||||
|
||||
Reference in New Issue
Block a user