mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-04 20:03:04 +02:00
introduced ImplicitHosting.
This commit is contained in:
parent
26c0fea840
commit
1677e38935
6 changed files with 31 additions and 17 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue