MCPcopy
hub / github.com/livekit/livekit / RemoveParticipant

Method RemoveParticipant

pkg/service/roomservice.go:224–245  ·  view source on GitHub ↗
(ctx context.Context, req *livekit.RoomParticipantIdentity)

Source from the content-addressed store, hash-verified

222}
223
224func (s *RoomService) RemoveParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.RemoveParticipantResponse, error) {
225 RecordRequest(ctx, req)
226
227 AppendLogFields(ctx, "room", req.Room, "participant", req.Identity)
228
229 if err := EnsureAdminPermission(ctx, livekit.RoomName(req.Room)); err != nil {
230 return nil, twirpAuthError(err)
231 }
232
233 if os, ok := s.roomStore.(OSSServiceStore); ok {
234 found, err := os.HasParticipant(ctx, livekit.RoomName(req.Room), livekit.ParticipantIdentity(req.Identity))
235 if err != nil {
236 return nil, err
237 } else if !found {
238 return nil, ErrParticipantNotFound
239 }
240 }
241
242 res, err := s.participantClient.RemoveParticipant(ctx, s.topicFormatter.ParticipantTopic(ctx, livekit.RoomName(req.Room), livekit.ParticipantIdentity(req.Identity)), req)
243 RecordResponse(ctx, res)
244 return res, err
245}
246
247func (s *RoomService) MutePublishedTrack(ctx context.Context, req *livekit.MuteRoomTrackRequest) (*livekit.MuteRoomTrackResponse, error) {
248 RecordRequest(ctx, req)

Callers

nothing calls this directly

Calls 7

RecordRequestFunction · 0.85
AppendLogFieldsFunction · 0.85
EnsureAdminPermissionFunction · 0.85
twirpAuthErrorFunction · 0.85
RecordResponseFunction · 0.85
HasParticipantMethod · 0.65
RemoveParticipantMethod · 0.65

Tested by

no test coverage detected