Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow updating participant attributes with updateParticipant #75

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ spotless {

val protoc_platform: String? by project
val protoSrc = arrayOf(
"$projectDir/protocol/protobufs/livekit_agent.proto",
"$projectDir/protocol/protobufs/livekit_agent_dispatch.proto",
"$projectDir/protocol/protobufs/livekit_analytics.proto",
"$projectDir/protocol/protobufs/livekit_egress.proto",
"$projectDir/protocol/protobufs/livekit_ingress.proto",
Expand Down
2 changes: 1 addition & 1 deletion protocol
Submodule protocol updated 108 files
8 changes: 8 additions & 0 deletions src/main/kotlin/io/livekit/server/RoomServiceClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ class RoomServiceClient(
* @param name optional, participant name to update
* @param metadata optional, metadata to update
* @param participantPermission optional, new permissions to assign to participant
* @param attributes attributes to update. It will make updates only to keys that
* are present in [attributes], and will not override others. To delete a value,
* set the value to an empty string.
*/
@JvmOverloads
fun updateParticipant(
Expand All @@ -225,6 +228,7 @@ class RoomServiceClient(
name: String? = null,
metadata: String? = null,
participantPermission: LivekitModels.ParticipantPermission? = null,
attributes: Map<String, String>? = null,
): Call<LivekitModels.ParticipantInfo> {
val request = with(LivekitRoom.UpdateParticipantRequest.newBuilder()) {
this.room = roomName
Expand All @@ -238,6 +242,10 @@ class RoomServiceClient(
if (participantPermission != null) {
this.permission = participantPermission
}
if (attributes != null) {
this.putAllAttributes(attributes)
}

build()
}

Expand Down
Loading