add legacy webrtc handler.

This commit is contained in:
Miroslav Šedivý 2024-07-20 23:37:20 +02:00
parent 1d8ec58fbc
commit 9ea9c1c208
4 changed files with 161 additions and 0 deletions

View file

@ -68,6 +68,12 @@ func (session *SessionCtx) IsHost() bool {
return session.manager.isHost(session)
}
// only needed for legacy webrtc handler
func (session *SessionCtx) LegacyIsHost() bool {
implicitHosting := session.manager.Settings().ImplicitHosting
return !(!implicitHosting && !session.manager.isHost(session)) || (implicitHosting && !session.profile.CanHost)
}
func (session *SessionCtx) SetAsHost() {
session.manager.setHost(session, session)
}