Refactor participant metadata updates to avoid duplication (#1679)

* Refactor participant metadata updates to avoid duplication

* generated fakes
This commit is contained in:
David Zhao
2023-05-03 13:50:45 -07:00
committed by GitHub
parent 4bd20c77b7
commit 5fcd682fb0
6 changed files with 58 additions and 15 deletions
+9
View File
@@ -649,6 +649,15 @@ func (r *Room) SetMetadata(metadata string) {
r.protoProxy.MarkDirty(true)
}
func (r *Room) UpdateParticipantMetadata(participant types.LocalParticipant, name string, metadata string) {
if metadata != "" {
participant.SetMetadata(metadata)
}
if name != "" {
participant.SetName(name)
}
}
func (r *Room) sendRoomUpdate() {
roomInfo := r.ToProto()
// Send update to participants