mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-31 01:47:24 +02:00
+ CanHost.
This commit is contained in:
parent
92aa717a8d
commit
5edd9dc97a
3 changed files with 32 additions and 3 deletions
|
@ -7,6 +7,11 @@ import (
|
|||
)
|
||||
|
||||
func (h *MessageHandlerCtx) controlRelease(session types.Session) error {
|
||||
if !session.CanHost() {
|
||||
h.logger.Debug().Str("id", session.ID()).Msg("is not allowed to host")
|
||||
return nil
|
||||
}
|
||||
|
||||
if !session.IsHost() {
|
||||
h.logger.Debug().Str("id", session.ID()).Msg("is not the host")
|
||||
return nil
|
||||
|
@ -25,6 +30,11 @@ func (h *MessageHandlerCtx) controlRelease(session types.Session) error {
|
|||
}
|
||||
|
||||
func (h *MessageHandlerCtx) controlRequest(session types.Session) error {
|
||||
if !session.CanHost() {
|
||||
h.logger.Debug().Str("id", session.ID()).Msg("is not allowed to host")
|
||||
return nil
|
||||
}
|
||||
|
||||
if session.IsHost() {
|
||||
h.logger.Debug().Str("id", session.ID()).Msg("is already the host")
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue