Do not send hidden participants after resume (#1689)
This commit is contained in:
+14
-1
@@ -412,7 +412,8 @@ func (r *Room) ResumeParticipant(p types.LocalParticipant, requestSource routing
|
||||
return err
|
||||
}
|
||||
|
||||
updates := ToProtoParticipants(r.GetParticipants())
|
||||
// include the local participant's info as well, since metadata could have been changed
|
||||
updates := r.getOtherParticipantInfo("")
|
||||
if err := p.SendParticipantUpdate(updates); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -730,6 +731,18 @@ func (r *Room) SimulateScenario(participant types.LocalParticipant, simulateScen
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *Room) getOtherParticipantInfo(identity livekit.ParticipantIdentity) []*livekit.ParticipantInfo {
|
||||
participants := r.GetParticipants()
|
||||
pi := make([]*livekit.ParticipantInfo, 0, len(participants))
|
||||
for _, p := range participants {
|
||||
if !p.Hidden() && p.Identity() != identity {
|
||||
pi = append(pi, p.ToProto())
|
||||
}
|
||||
}
|
||||
|
||||
return pi
|
||||
}
|
||||
|
||||
// checks if participant should be autosubscribed to new tracks, assumes lock is already acquired
|
||||
func (r *Room) autoSubscribe(participant types.LocalParticipant) bool {
|
||||
opts := r.participantOpts[participant.Identity()]
|
||||
|
||||
@@ -10,8 +10,6 @@ import (
|
||||
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/logger"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -45,14 +43,6 @@ func UnpackDataTrackLabel(packed string) (participantID livekit.ParticipantID, t
|
||||
return
|
||||
}
|
||||
|
||||
func ToProtoParticipants(participants []types.LocalParticipant) []*livekit.ParticipantInfo {
|
||||
infos := make([]*livekit.ParticipantInfo, 0, len(participants))
|
||||
for _, op := range participants {
|
||||
infos = append(infos, op.ToProto())
|
||||
}
|
||||
return infos
|
||||
}
|
||||
|
||||
func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription {
|
||||
return &livekit.SessionDescription{
|
||||
Type: sd.Type.String(),
|
||||
|
||||
Reference in New Issue
Block a user