mirror of
https://github.com/livekit/livekit.git
synced 2026-08-28 05:04:10 +00:00
Fix data packet ParticipantIdentity override logic in participant.go (#3735)
* Fix data packet ParticipantIdentity override logic in participant.go https://github.com/livekit/agents/issues/2554 * Update pkg/rtc/participant.go --------- Co-authored-by: David Zhao <david@davidzhao.com>
This commit is contained in:
co-authored by
David Zhao
parent
068b43660b
commit
03d3fcab43
@@ -2264,10 +2264,15 @@ func (p *ParticipantImpl) handleReceivedDataMessage(kind livekit.DataPacket_Kind
|
||||
p.pubLogger.Warnw("received unsupported data packet", nil, "payload", payload)
|
||||
}
|
||||
|
||||
if p.Hidden() {
|
||||
dp.ParticipantIdentity = ""
|
||||
} else if overrideSenderIdentity {
|
||||
dp.ParticipantIdentity = string(p.params.Identity)
|
||||
// SFU typically asserts the sender's identity. However, agents are able to
|
||||
// publish data on behalf of the participant in case of transcriptions/text streams
|
||||
// in those cases we'd leave the existing identity on the data packet alone.
|
||||
if overrideSenderIdentity {
|
||||
if p.Hidden() {
|
||||
dp.ParticipantIdentity = ""
|
||||
} else {
|
||||
dp.ParticipantIdentity = string(p.params.Identity)
|
||||
}
|
||||
}
|
||||
|
||||
if shouldForwardData {
|
||||
|
||||
Reference in New Issue
Block a user