mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-30 23:09:01 +02:00
fix kicked message for legacy implementation.
This commit is contained in:
parent
4f401ac2b6
commit
82aa68097b
2 changed files with 11 additions and 1 deletions
|
@ -165,6 +165,11 @@ func (s *session) wsToClient(msg []byte) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// if profile change is the reason for disconnect, it's a kick event
|
||||
if request.Message == "profile changed" {
|
||||
request.Message = "kicked"
|
||||
}
|
||||
|
||||
return s.toClient(&oldMessage.SystemMessage{
|
||||
Event: oldEvent.SYSTEM_DISCONNECT,
|
||||
Message: request.Message,
|
||||
|
|
|
@ -47,7 +47,12 @@ func (session *SessionCtx) profileChanged() {
|
|||
}
|
||||
|
||||
if (!session.profile.CanConnect || !session.profile.CanLogin || !session.profile.CanWatch) && session.state.IsWatching {
|
||||
// TODO: Needed for legacy implementation. Websocket must die before webrtc and deliver signal close message
|
||||
// otherwise webrtc destroy would trigger websocket reconnect. In case of kick event, webrtc destroy is called
|
||||
// before websocket destroy that delivers the information about the kick.
|
||||
time.AfterFunc(time.Second, func() {
|
||||
session.GetWebRTCPeer().Destroy()
|
||||
})
|
||||
}
|
||||
|
||||
if (!session.profile.CanConnect || !session.profile.CanLogin) && session.state.IsConnected {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue