1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Add support for custom languages.

This commit is contained in:
Ferdinand Mütsch
2019-05-21 17:16:46 +02:00
parent c2b705f172
commit c821e02b82
7 changed files with 56 additions and 24 deletions

View File

@ -32,13 +32,14 @@ func (h *HeartbeatHandler) Post(w http.ResponseWriter, r *http.Request) {
return
}
for _, h := range heartbeats {
h.OperatingSystem = opSys
h.Editor = editor
h.User = user
h.UserID = user.ID
for _, hb := range heartbeats {
hb.OperatingSystem = opSys
hb.Editor = editor
hb.User = user
hb.UserID = user.ID
hb.Augment(h.HeartbeatSrvc.Config.CustomLanguages)
if !h.Valid() {
if !hb.Valid() {
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte("Invalid heartbeat object."))
return