From 6815d85c01eaafa596d392c73074a018e2e13a1d Mon Sep 17 00:00:00 2001 From: Denys Smirnov Date: Thu, 27 Jun 2024 17:39:05 +0300 Subject: [PATCH] Broadcast attributes update. (#2825) --- pkg/rtc/participant.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 95636b1d9..1e113bc14 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -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