Skip to content

Commit 8bcbf55

Browse files
fix: apply original participant fields in data messages (#709)
* fix: apply original participant fields in data messages * code formatting
1 parent 10f3580 commit 8bcbf55

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

livekit/src/rtc_engine/rtc_session.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,15 +1042,10 @@ impl SessionInner {
10421042
// Participant SID and identity used to be defined on user packet, but
10431043
// they have been moved to the packet root. For backwards compatibility,
10441044
// we take the user packet's values if the top-level fields are not set.
1045-
let participant_sid = participant_sid
1046-
.is_none()
1047-
.then_some(user.participant_sid)
1048-
.and_then(|sid| sid.try_into().ok());
1049-
let participant_identity = participant_identity
1050-
.is_none()
1051-
.then_some(user.participant_identity)
1052-
.and_then(|identity| identity.try_into().ok());
1053-
1045+
let participant_sid =
1046+
participant_sid.or_else(|| user.participant_sid.try_into().ok());
1047+
let participant_identity =
1048+
participant_identity.or_else(|| user.participant_identity.try_into().ok());
10541049
self.emitter.send(SessionEvent::Data {
10551050
kind,
10561051
participant_sid,

0 commit comments

Comments
 (0)