code indentation.

This commit is contained in:
Miroslav Šedivý 2020-11-16 17:48:10 +01:00
parent 234b0a2e06
commit b411675108
2 changed files with 13 additions and 11 deletions

View File

@ -17,13 +17,14 @@ func (h *MessageHandlerCtx) screenSet(session types.Session, payload *message.Sc
return err return err
} }
if err := h.sessions.Broadcast(message.ScreenResolution{ if err := h.sessions.Broadcast(
Event: event.SCREEN_RESOLUTION, message.ScreenResolution{
ID: session.ID(), Event: event.SCREEN_RESOLUTION,
Width: payload.Width, ID: session.ID(),
Height: payload.Height, Width: payload.Width,
Rate: payload.Rate, Height: payload.Height,
}, nil); err != nil { Rate: payload.Rate,
}, nil); err != nil {
h.logger.Warn().Err(err).Msgf("sending event %s has failed", event.SCREEN_RESOLUTION) h.logger.Warn().Err(err).Msgf("sending event %s has failed", event.SCREEN_RESOLUTION)
return err return err
} }

View File

@ -85,10 +85,11 @@ func (h *MessageHandlerCtx) SessionDisconnected(session types.Session) error {
// clear host if exists // clear host if exists
if session.IsHost() { if session.IsHost() {
h.sessions.ClearHost() h.sessions.ClearHost()
if err := h.sessions.Broadcast(message.Control{ if err := h.sessions.Broadcast(
Event: event.CONTROL_RELEASE, message.Control{
ID: session.ID(), Event: event.CONTROL_RELEASE,
}, nil); err != nil { ID: session.ID(),
}, nil); err != nil {
h.logger.Warn().Err(err).Msgf("broadcasting event %s has failed", event.CONTROL_RELEASE) h.logger.Warn().Err(err).Msgf("broadcasting event %s has failed", event.CONTROL_RELEASE)
} }
} }