Skip to content

Commit b4065a4

Browse files
authored
feat(room): move participant (#575)
* feat(room): move participant * chore(go.mod) tidy
1 parent 1344b16 commit b4065a4

File tree

3 files changed

+107
-74
lines changed

3 files changed

+107
-74
lines changed

cmd/lk/room.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,21 @@ var (
230230
},
231231
},
232232
},
233+
{
234+
Name: "move",
235+
Usage: "Move a participant to a different room",
236+
ArgsUsage: "ROOM_NAME",
237+
Before: createRoomClient,
238+
Action: moveParticipant,
239+
Flags: []cli.Flag{
240+
roomFlag,
241+
identityFlag,
242+
&cli.StringFlag{
243+
Name: "destination-room",
244+
Usage: "`NAME` of the destination room",
245+
},
246+
},
247+
},
233248
{
234249
Name: "update",
235250
Usage: "Change the metadata and permissions for a room participant",
@@ -1102,6 +1117,26 @@ func forwardParticipant(ctx context.Context, cmd *cli.Command) error {
11021117
return nil
11031118
}
11041119

1120+
func moveParticipant(ctx context.Context, cmd *cli.Command) error {
1121+
roomName, identity := participantInfoFromArgOrFlags(cmd)
1122+
destinationRoomName := cmd.String("destination-room")
1123+
if destinationRoomName == "" {
1124+
return fmt.Errorf("destination-room is required")
1125+
}
1126+
1127+
_, err := roomClient.MoveParticipant(ctx, &livekit.MoveParticipantRequest{
1128+
Room: roomName,
1129+
Identity: identity,
1130+
DestinationRoom: destinationRoomName,
1131+
})
1132+
if err != nil {
1133+
return err
1134+
}
1135+
1136+
fmt.Println("successfully moved participant", identity, "from", roomName, "to", destinationRoomName)
1137+
return nil
1138+
}
1139+
11051140
func muteTrack(ctx context.Context, cmd *cli.Command) error {
11061141
roomName, identity := participantInfoFromFlags(cmd)
11071142
muted := cmd.Bool("mute") || !cmd.Bool("unmute")

go.mod

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ require (
1313
github.com/go-logr/logr v1.4.2
1414
github.com/go-task/task/v3 v3.43.3
1515
github.com/joho/godotenv v1.5.1
16-
github.com/livekit/protocol v1.38.0
17-
github.com/livekit/server-sdk-go/v2 v2.7.0
16+
github.com/livekit/protocol v1.38.1-0.20250514155317-3ee266441614
17+
github.com/livekit/server-sdk-go/v2 v2.8.2-0.20250515040018-ffbd52b92948
1818
github.com/moby/buildkit v0.21.1
1919
github.com/pion/rtcp v1.2.15
2020
github.com/pion/rtp v1.8.15
@@ -34,9 +34,10 @@ require (
3434
)
3535

3636
require (
37-
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250307204501-0409229c3780.1 // indirect
38-
buf.build/go/protoyaml v0.3.2 // indirect
39-
cel.dev/expr v0.23.1 // indirect
37+
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.6-20250425153114-8976f5be98c1.1 // indirect
38+
buf.build/go/protovalidate v0.12.0 // indirect
39+
buf.build/go/protoyaml v0.6.0 // indirect
40+
cel.dev/expr v0.24.0 // indirect
4041
dario.cat/mergo v1.0.1 // indirect
4142
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect
4243
github.com/Ladicle/tabwriter v1.0.0 // indirect
@@ -49,7 +50,6 @@ require (
4950
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
5051
github.com/benbjohnson/clock v1.3.5 // indirect
5152
github.com/bep/debounce v1.2.1 // indirect
52-
github.com/bufbuild/protovalidate-go v0.9.2 // indirect
5353
github.com/catppuccin/go v0.3.0 // indirect
5454
github.com/cespare/xxhash/v2 v2.3.0 // indirect
5555
github.com/chainguard-dev/git-urls v1.0.2 // indirect
@@ -73,7 +73,7 @@ require (
7373
github.com/containerd/typeurl/v2 v2.2.3 // indirect
7474
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
7575
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
76-
github.com/dennwc/iters v1.0.1 // indirect
76+
github.com/dennwc/iters v1.1.0 // indirect
7777
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
7878
github.com/distribution/reference v0.6.0 // indirect
7979
github.com/dlclark/regexp2 v1.11.5 // indirect
@@ -99,7 +99,7 @@ require (
9999
github.com/gogo/protobuf v1.3.2 // indirect
100100
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
101101
github.com/golang/protobuf v1.5.4 // indirect
102-
github.com/google/cel-go v0.24.1 // indirect
102+
github.com/google/cel-go v0.25.0 // indirect
103103
github.com/google/go-cmp v0.7.0 // indirect
104104
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
105105
github.com/google/uuid v1.6.0 // indirect
@@ -116,9 +116,9 @@ require (
116116
github.com/klauspost/compress v1.18.0 // indirect
117117
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
118118
github.com/lithammer/shortuuid/v4 v4.2.0 // indirect
119-
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 // indirect
120-
github.com/livekit/mediatransportutil v0.0.0-20250310153736-45596af895b6 // indirect
121-
github.com/livekit/psrpc v0.6.1-0.20250205181828-a0beed2e4126 // indirect
119+
github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731 // indirect
120+
github.com/livekit/mediatransportutil v0.0.0-20250511054114-5f8c73435f62 // indirect
121+
github.com/livekit/psrpc v0.6.1-0.20250511053145-465289d72c3c // indirect
122122
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
123123
github.com/magefile/mage v1.15.0 // indirect
124124
github.com/mattn/go-colorable v0.1.13 // indirect
@@ -135,8 +135,8 @@ require (
135135
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
136136
github.com/muesli/cancelreader v0.2.2 // indirect
137137
github.com/muesli/termenv v0.16.0 // indirect
138-
github.com/nats-io/nats.go v1.41.1 // indirect
139-
github.com/nats-io/nkeys v0.4.10 // indirect
138+
github.com/nats-io/nats.go v1.42.0 // indirect
139+
github.com/nats-io/nkeys v0.4.11 // indirect
140140
github.com/nats-io/nuid v1.0.1 // indirect
141141
github.com/opencontainers/go-digest v1.0.0 // indirect
142142
github.com/opencontainers/image-spec v1.1.1 // indirect
@@ -152,12 +152,12 @@ require (
152152
github.com/pion/srtp/v3 v3.0.4 // indirect
153153
github.com/pion/stun/v3 v3.0.0 // indirect
154154
github.com/pion/transport/v3 v3.0.7 // indirect
155-
github.com/pion/turn/v4 v4.0.0 // indirect
155+
github.com/pion/turn/v4 v4.0.1 // indirect
156156
github.com/pjbgf/sha1cd v0.3.2 // indirect
157157
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
158158
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
159159
github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect
160-
github.com/redis/go-redis/v9 v9.7.3 // indirect
160+
github.com/redis/go-redis/v9 v9.8.0 // indirect
161161
github.com/rivo/uniseg v0.4.7 // indirect
162162
github.com/sajari/fuzzy v1.0.0 // indirect
163163
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
@@ -189,15 +189,15 @@ require (
189189
go.uber.org/multierr v1.11.0 // indirect
190190
go.uber.org/zap v1.27.0 // indirect
191191
go.uber.org/zap/exp v0.3.0 // indirect
192-
golang.org/x/crypto v0.37.0 // indirect
193-
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
194-
golang.org/x/net v0.39.0 // indirect
195-
golang.org/x/sys v0.32.0 // indirect
196-
golang.org/x/term v0.31.0 // indirect
197-
golang.org/x/text v0.24.0 // indirect
198-
google.golang.org/genproto/googleapis/api v0.0.0-20250407143221-ac9807e6c755 // indirect
199-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250407143221-ac9807e6c755 // indirect
200-
google.golang.org/grpc v1.71.1 // indirect
192+
golang.org/x/crypto v0.38.0 // indirect
193+
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 // indirect
194+
golang.org/x/net v0.40.0 // indirect
195+
golang.org/x/sys v0.33.0 // indirect
196+
golang.org/x/term v0.32.0 // indirect
197+
golang.org/x/text v0.25.0 // indirect
198+
google.golang.org/genproto/googleapis/api v0.0.0-20250512202823-5a2f75b736a9 // indirect
199+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250512202823-5a2f75b736a9 // indirect
200+
google.golang.org/grpc v1.72.1 // indirect
201201
gopkg.in/inf.v0 v0.9.1 // indirect
202202
gopkg.in/warnings.v0 v0.1.2 // indirect
203203
mvdan.cc/sh/v3 v3.11.0 // indirect

0 commit comments

Comments
 (0)