Support for participant attributes (#2806)

* Support for participant attributes

* move metadata setters to LocalParticipant

* address feedback

* forward error

* update go mod

* update attributes first
This commit is contained in:
David Zhao
2024-06-19 23:14:19 -07:00
committed by GitHub
parent d4e50b633f
commit 7a774cc82a
24 changed files with 388 additions and 142 deletions
+12 -1
View File
@@ -819,13 +819,24 @@ func (r *Room) SetMetadata(metadata string) <-chan struct{} {
return r.protoProxy.MarkDirty(true)
}
func (r *Room) UpdateParticipantMetadata(participant types.LocalParticipant, name string, metadata string) {
func (r *Room) UpdateParticipantMetadata(
participant types.LocalParticipant,
name string,
metadata string,
attributes map[string]string,
) error {
if attributes != nil && len(attributes) > 0 {
if err := participant.SetAttributes(attributes); err != nil {
return err
}
}
if metadata != "" {
participant.SetMetadata(metadata)
}
if name != "" {
participant.SetName(name)
}
return nil
}
func (r *Room) sendRoomUpdate() {