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:
+12
-1
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user