mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-30 23:09:01 +02:00
add profileChanged.
This commit is contained in:
parent
a2da60d617
commit
2467c94c59
2 changed files with 19 additions and 0 deletions
|
@ -59,6 +59,24 @@ func (session *SessionCtx) CanAccessClipboard() bool {
|
|||
return session.profile.CanAccessClipboard
|
||||
}
|
||||
|
||||
func (session *SessionCtx) profileChanged() {
|
||||
if !session.CanHost() && session.IsHost() {
|
||||
session.manager.ClearHost()
|
||||
}
|
||||
|
||||
if !session.CanWatch() && session.IsWatching() {
|
||||
if err := session.webrtc_peer.Destroy(); err != nil {
|
||||
session.logger.Warn().Err(err).Msgf("webrtc destroy has failed")
|
||||
}
|
||||
}
|
||||
|
||||
if !session.CanConnect() && session.IsConnected() {
|
||||
if err := session.Disconnect("profile changed"); err != nil {
|
||||
session.logger.Warn().Err(err).Msgf("websocket destroy has failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---
|
||||
// runtime
|
||||
// ---
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue