Skip to content

Commit

Permalink
if locked, notify admin about that on join
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Jan 18, 2021
1 parent a0fffd3 commit 1e186e8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/internal/websocket/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1e186e8

Please sign in to comment.