mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
profileChanged tested, minor bugs fixed.
This commit is contained in:
parent
9ca4e04e0b
commit
303c22bba5
@ -62,6 +62,12 @@ func (session *SessionCtx) CanAccessClipboard() bool {
|
|||||||
func (session *SessionCtx) profileChanged() {
|
func (session *SessionCtx) profileChanged() {
|
||||||
if !session.CanHost() && session.IsHost() {
|
if !session.CanHost() && session.IsHost() {
|
||||||
session.manager.ClearHost()
|
session.manager.ClearHost()
|
||||||
|
|
||||||
|
session.manager.Broadcast(
|
||||||
|
message.ControlHost{
|
||||||
|
Event: event.CONTROL_HOST,
|
||||||
|
HasHost: false,
|
||||||
|
}, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !session.CanWatch() && session.IsWatching() {
|
if !session.CanWatch() && session.IsWatching() {
|
||||||
@ -70,7 +76,7 @@ func (session *SessionCtx) profileChanged() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !session.CanConnect() && session.IsConnected() {
|
if (!session.CanConnect() || !session.CanLogin()) && session.IsConnected() {
|
||||||
if err := session.Disconnect("profile changed"); err != nil {
|
if err := session.Disconnect("profile changed"); err != nil {
|
||||||
session.logger.Warn().Err(err).Msgf("websocket destroy has failed")
|
session.logger.Warn().Err(err).Msgf("websocket destroy has failed")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user