diff --git a/internal/websocket/handler/broadcast.go b/internal/websocket/handler/broadcast.go index 1fa0c766..adb5fe18 100644 --- a/internal/websocket/handler/broadcast.go +++ b/internal/websocket/handler/broadcast.go @@ -13,12 +13,7 @@ func (h *MessageHandlerCtx) boradcastCreate(session types.Session, payload *mess } h.capture.StartBroadcast(payload.URL) - - if err := h.boradcastStatus(session); err != nil { - return err - } - - return nil + return h.boradcastStatus(session) } func (h *MessageHandlerCtx) boradcastDestroy(session types.Session) error { @@ -28,12 +23,7 @@ func (h *MessageHandlerCtx) boradcastDestroy(session types.Session) error { } h.capture.StopBroadcast() - - if err := h.boradcastStatus(session); err != nil { - return err - } - - return nil + return h.boradcastStatus(session) } func (h *MessageHandlerCtx) boradcastStatus(session types.Session) error { diff --git a/internal/websocket/handler/signal.go b/internal/websocket/handler/signal.go index b9b76d42..7edbb47f 100644 --- a/internal/websocket/handler/signal.go +++ b/internal/websocket/handler/signal.go @@ -12,25 +12,16 @@ func (h *MessageHandlerCtx) signalProvide(session types.Session) error { return err } - if err := session.Send(message.SignalProvide{ + return session.Send(message.SignalProvide{ Event: event.SIGNAL_PROVIDE, ID: session.ID(), SDP: sdp, Lite: lite, ICE: ice, - }); err != nil { - return err - } - - return nil + }) } func (h *MessageHandlerCtx) signalAnswer(session types.Session, payload *message.SignalAnswer) error { session.SetName(payload.DisplayName) - - if err := session.SignalAnswer(payload.SDP); err != nil { - return err - } - - return nil + return session.SignalAnswer(payload.SDP) }