From 1e186e8239362910f8b98aa83b0f73144a93616f Mon Sep 17 00:00:00 2001 From: m1k1o Date: Mon, 18 Jan 2021 13:07:25 +0100 Subject: [PATCH] if locked, notify admin about that on join --- server/internal/websocket/session.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/internal/websocket/session.go b/server/internal/websocket/session.go index 9151aa2..899368d 100644 --- a/server/internal/websocket/session.go +++ b/server/internal/websocket/session.go @@ -22,6 +22,17 @@ func (h *MessageHandler) SessionCreated(id string, session types.Session) error if err := h.boradcastStatus(session); err != nil { return err } + + // if locked, notify admin about that + if h.locked { + if err := session.Send(message.MembersList{ + Event: event.ADMIN_LOCK, + ID: id, + }); err != nil { + h.logger.Warn().Str("id", id).Err(err).Msgf("sending event %s has failed", event.ADMIN_LOCK) + return err + } + } } return nil