mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-22 19:17:52 +02:00
if locked, notify admin about that on join
This commit is contained in:
parent
a0fffd3e5c
commit
1e186e8239
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue