move CanPublishData check to DataTrack (#490)

* move CanPublishData check to DataTrack

* fix test
This commit is contained in:
cnderrauber
2022-03-08 12:02:18 +08:00
committed by GitHub
parent dca695bd68
commit 7c0f789316
3 changed files with 9 additions and 5 deletions
-4
View File
@@ -642,10 +642,6 @@ func (r *Room) onParticipantMetadataUpdate(p types.LocalParticipant) {
}
func (r *Room) onDataPacket(source types.LocalParticipant, dp *livekit.DataPacket) {
// don't forward if source isn't allowed to publish data
if source != nil && !source.CanPublishData() {
return
}
dest := dp.GetUser().GetDestinationSids()
for _, op := range r.GetParticipants() {