Skip to content

Commit

Permalink
room sid changed
Browse files Browse the repository at this point in the history
  • Loading branch information
keepingitneil committed Jul 12, 2024
1 parent ed28ba7 commit cb748b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions livekit-rtc/livekit/rtc/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def publish_data(
self,
payload: Union[bytes, str],
reliable: bool = True,
destination_sids: List[Union[str, "RemoteParticipant"]] = [],
destination_identities: List[Union[str, "RemoteParticipant"]] = [],
topic: str = "",
) -> None:
if isinstance(payload, str):
Expand All @@ -110,13 +110,13 @@ async def publish_data(
req.publish_data.topic = topic

sids = []
for p in destination_sids:
for p in destination_identities:
if isinstance(p, RemoteParticipant):
sids.append(p.sid)
else:
sids.append(p)

req.publish_data.destination_sids.extend(sids)
req.publish_data.destination_identities.extend(sids)

queue = FfiClient.instance.queue.subscribe()
try:
Expand Down
5 changes: 5 additions & 0 deletions livekit-rtc/livekit/rtc/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"track_unmuted",
"active_speakers_changed",
"room_metadata_changed",
"room_sid_changed",
"participant_metadata_changed",
"participant_name_changed",
"connection_quality_changed",
Expand Down Expand Up @@ -360,6 +361,10 @@ def _on_room_event(self, event: proto_room.RoomEvent):
old_metadata = self.metadata
self._info.metadata = event.room_metadata_changed.metadata
self.emit("room_metadata_changed", old_metadata, self.metadata)
elif which == "room_sid_changed":
old_sid = self.sid
self._info.sid = event.room_sid_changed.sid
self.emit("room_sid_changed", old_sid, self.sid)
elif which == "participant_metadata_changed":
sid = event.participant_metadata_changed.participant_sid
# TODO: pass participant identity
Expand Down

0 comments on commit cb748b8

Please sign in to comment.