mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 13:25:42 +00:00
Add back region when hydrating ParticipantInit. (#648)
It was left out in the previous PR #646
This commit is contained in:
@@ -122,7 +122,7 @@ func (pi *ParticipantInit) ToStartSession(roomName livekit.RoomName, connectionI
|
||||
}, nil
|
||||
}
|
||||
|
||||
func ParticipantInitFromStartSession(ss *livekit.StartSession) (*ParticipantInit, error) {
|
||||
func ParticipantInitFromStartSession(ss *livekit.StartSession, region string) (*ParticipantInit, error) {
|
||||
claims := &auth.ClaimGrants{}
|
||||
if err := json.Unmarshal([]byte(ss.GrantsJson), claims); err != nil {
|
||||
return nil, err
|
||||
@@ -135,6 +135,7 @@ func ParticipantInitFromStartSession(ss *livekit.StartSession) (*ParticipantInit
|
||||
Client: ss.Client,
|
||||
AutoSubscribe: ss.AutoSubscribe,
|
||||
Grants: claims,
|
||||
Region: region,
|
||||
AdaptiveStream: ss.AdaptiveStream,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ func (r *RedisRouter) startParticipantRTC(ss *livekit.StartSession, participantK
|
||||
}
|
||||
}
|
||||
|
||||
pi, err := ParticipantInitFromStartSession(ss)
|
||||
pi, err := ParticipantInitFromStartSession(ss, r.currentNode.Region)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user