1
0
mirror of synced 2024-11-22 04:26:01 +03:00

Merge pull request #14 from gwinn/master

Update mg webhook response
This commit is contained in:
Alex Lushpai 2018-06-06 12:55:20 +03:00 committed by GitHub
commit 80f4e16fc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,8 +203,19 @@ func mgWebhookHandler(w http.ResponseWriter, r *http.Request) {
logger.Debugf("mgWebhookHandler sent %v", msg)
}
rsp, err := json.Marshal(map[string]string{"external_message_id": strconv.Itoa(msg.MessageID)})
if err != nil {
raven.CaptureErrorAndWait(err, nil)
logger.Error(err)
return
}
if config.Debug {
logger.Debugf("mgWebhookHandler sent response %v", rsp)
}
w.WriteHeader(http.StatusOK)
w.Write([]byte("Message sent"))
w.Write(rsp)
}
if msg.Type == "message_updated" {