+ CanHost.

This commit is contained in:
Miroslav Šedivý 2020-12-06 18:50:41 +01:00
parent 92aa717a8d
commit 5edd9dc97a
3 changed files with 32 additions and 3 deletions

View file

@ -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