introduced ImplicitHosting.

This commit is contained in:
Miroslav Šedivý 2020-12-02 11:24:20 +01:00
parent 26c0fea840
commit 1677e38935
6 changed files with 31 additions and 17 deletions

View file

@ -30,16 +30,16 @@ func (h *MessageHandlerCtx) controlRequest(session types.Session) error {
return nil
}
// TODO: Allow implicit requests.
host := h.sessions.GetHost()
if host != nil {
// tell session there is a host
return session.Send(
message.ControlHost{
Event: event.CONTROL_HOST,
HasHost: true,
HostID: host.ID(),
})
if !h.sessions.ImplicitHosting() {
// tell session if there is a host
if host := h.sessions.GetHost(); host != nil {
return session.Send(
message.ControlHost{
Event: event.CONTROL_HOST,
HasHost: true,
HostID: host.ID(),
})
}
}
h.sessions.SetHost(session)