mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-28 05:58:49 +02:00
private mode implementation.
This commit is contained in:
parent
f549171ded
commit
d004ddd68f
12 changed files with 160 additions and 11 deletions
|
@ -44,6 +44,11 @@ func (session *SessionCtx) profileChanged() {
|
|||
if (!session.profile.CanConnect || !session.profile.CanLogin) && session.state.IsConnected {
|
||||
session.GetWebSocketPeer().Destroy("profile changed")
|
||||
}
|
||||
|
||||
// update webrtc paused state
|
||||
if webrtcPeer := session.GetWebRTCPeer(); webrtcPeer != nil {
|
||||
webrtcPeer.SetPaused(session.PrivateModeEnabled())
|
||||
}
|
||||
}
|
||||
|
||||
func (session *SessionCtx) State() types.SessionState {
|
||||
|
@ -54,6 +59,10 @@ func (session *SessionCtx) IsHost() bool {
|
|||
return session.manager.GetHost() == session
|
||||
}
|
||||
|
||||
func (session *SessionCtx) PrivateModeEnabled() bool {
|
||||
return session.manager.PrivateMode() && !session.profile.IsAdmin
|
||||
}
|
||||
|
||||
func (session *SessionCtx) SetCursor(cursor types.Cursor) {
|
||||
if session.manager.InactiveCursors() && session.profile.SendsInactiveCursor {
|
||||
session.manager.SetCursor(cursor, session)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue