return error when moving egree/agent participant (#3741)
This commit is contained in:
+14
-2
@@ -73,6 +73,10 @@ const (
|
||||
PingTimeoutSeconds = 15
|
||||
)
|
||||
|
||||
var (
|
||||
ErrMoveOldClientVersion = errors.New("participant client version does not support moving")
|
||||
)
|
||||
|
||||
// -------------------------------------------------
|
||||
|
||||
type pendingTrackInfo struct {
|
||||
@@ -3591,8 +3595,16 @@ func (p *ParticipantImpl) SupportsCodecChange() bool {
|
||||
return p.params.ClientInfo.SupportsCodecChange()
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) SupportsMoving() bool {
|
||||
return p.ProtocolVersion().SupportsMoving()
|
||||
func (p *ParticipantImpl) SupportsMoving() error {
|
||||
if !p.ProtocolVersion().SupportsMoving() {
|
||||
return ErrMoveOldClientVersion
|
||||
}
|
||||
|
||||
if kind := p.Kind(); kind == livekit.ParticipantInfo_EGRESS || kind == livekit.ParticipantInfo_AGENT {
|
||||
return fmt.Errorf("%s participants cannot be moved", kind.String())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) MoveToRoom(params types.MoveToRoomParams) {
|
||||
|
||||
Reference in New Issue
Block a user