mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
minor refactor ifs.
This commit is contained in:
parent
7c64e6068a
commit
f136a31b03
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user