Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
nicpottier committed Dec 6, 2017
1 parent 1e75f21 commit 64044c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions handlers/nexmo/nexmo.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ func NewHandler() courier.ChannelHandler {
// Initialize is called by the engine once everything is loaded
func (h *handler) Initialize(s courier.Server) error {
h.SetServer(s)
err := s.AddReceiveMsgRoute(h, "GET", "receive", h.ReceiveMessage)
err := s.AddHandlerRoute(h, "GET", "receive", h.ReceiveMessage)
if err != nil {
return err
}
return s.AddUpdateStatusRoute(h, "GET", "status", h.StatusMessage)
return s.AddHandlerRoute(h, "GET", "status", h.StatusMessage)
}

type nexmoDeliveryReport struct {
Expand All @@ -72,7 +72,7 @@ var statusMappings = map[string]courier.MsgStatusValue{
}

// StatusMessage is our HTTP handler function for status updates
func (h *handler) StatusMessage(channel courier.Channel, w http.ResponseWriter, r *http.Request) ([]courier.MsgStatus, error) {
func (h *handler) StatusMessage(channel courier.Channel, w http.ResponseWriter, r *http.Request) ([]courier.Event, error) {
nexmoDeliveryReport := &nexmoDeliveryReport{}
handlers.DecodeAndValidateQueryParams(nexmoDeliveryReport, r)

Expand All @@ -98,7 +98,7 @@ func (h *handler) StatusMessage(channel courier.Channel, w http.ResponseWriter,
return nil, err
}

return []courier.MsgStatus{status}, courier.WriteStatusSuccess(w, r, []courier.MsgStatus{status})
return []courier.Event{status}, courier.WriteStatusSuccess(w, r, []courier.MsgStatus{status})
}

type nexmoIncomingMessage struct {
Expand All @@ -109,7 +109,7 @@ type nexmoIncomingMessage struct {
}

// ReceiveMessage is our HTTP handler function for incoming messages
func (h *handler) ReceiveMessage(channel courier.Channel, w http.ResponseWriter, r *http.Request) ([]courier.ReceiveEvent, error) {
func (h *handler) ReceiveMessage(channel courier.Channel, w http.ResponseWriter, r *http.Request) ([]courier.Event, error) {
nexmoIncomingMessage := &nexmoIncomingMessage{}
handlers.DecodeAndValidateQueryParams(nexmoIncomingMessage, r)

Expand All @@ -134,7 +134,7 @@ func (h *handler) ReceiveMessage(channel courier.Channel, w http.ResponseWriter,
return nil, err
}

return []courier.ReceiveEvent{msg}, courier.WriteMsgSuccess(w, r, []courier.Msg{msg})
return []courier.Event{msg}, courier.WriteMsgSuccess(w, r, []courier.Msg{msg})
}

// SendMsg sends the passed in message, returning any error
Expand Down

0 comments on commit 64044c5

Please sign in to comment.