mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-15 18:17:42 +02:00
unlock room if no admins online
This commit is contained in:
parent
82ca6e13ca
commit
414b5a8015
3 changed files with 24 additions and 4 deletions
|
@ -42,6 +42,10 @@ func (h *MessageHandler) Connected(id string, socket *WebSocket) (bool, string,
|
|||
}
|
||||
|
||||
func (h *MessageHandler) Disconnected(id string) error {
|
||||
if h.locked && len(h.sessions.Admins()) == 0 {
|
||||
h.locked = false
|
||||
}
|
||||
|
||||
return h.sessions.Destroy(id)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue