(ctx context.Context, req *livekit.UpdateRoomMetadataRequest)
| 330 | } |
| 331 | |
| 332 | func (s *RoomService) UpdateRoomMetadata(ctx context.Context, req *livekit.UpdateRoomMetadataRequest) (*livekit.Room, error) { |
| 333 | RecordRequest(ctx, req) |
| 334 | |
| 335 | AppendLogFields(ctx, "room", req.Room, "size", len(req.Metadata)) |
| 336 | if !s.limitConf.CheckMetadataSize(req.Metadata) { |
| 337 | return nil, twirp.InvalidArgumentError(ErrMetadataExceedsLimits.Error(), strconv.Itoa(int(s.limitConf.MaxMetadataSize))) |
| 338 | } |
| 339 | |
| 340 | if err := EnsureAdminPermission(ctx, livekit.RoomName(req.Room)); err != nil { |
| 341 | return nil, twirpAuthError(err) |
| 342 | } |
| 343 | |
| 344 | exists, err := s.roomStore.RoomExists(ctx, livekit.RoomName(req.Room)) |
| 345 | if err != nil { |
| 346 | return nil, err |
| 347 | } else if !exists { |
| 348 | return nil, ErrRoomNotFound |
| 349 | } |
| 350 | |
| 351 | room, err := s.roomClient.UpdateRoomMetadata(ctx, s.topicFormatter.RoomTopic(ctx, livekit.RoomName(req.Room)), req) |
| 352 | if err != nil { |
| 353 | return nil, err |
| 354 | } |
| 355 | |
| 356 | RecordResponse(ctx, room) |
| 357 | return room, nil |
| 358 | } |
| 359 | |
| 360 | func (s *RoomService) ForwardParticipant(ctx context.Context, req *livekit.ForwardParticipantRequest) (*livekit.ForwardParticipantResponse, error) { |
| 361 | RecordRequest(ctx, req) |
nothing calls this directly
no test coverage detected