This commit is contained in:
Philipp Heckel 2022-04-17 14:29:43 -04:00
parent 967cde1fb5
commit 55869f551e
2 changed files with 10 additions and 3 deletions

View File

@ -541,6 +541,9 @@ func (s *Server) parsePublishParams(r *http.Request, v *visitor, m *message) (ca
if err := json.Unmarshal([]byte(actionsStr), &actions); err != nil { if err := json.Unmarshal([]byte(actionsStr), &actions); err != nil {
return false, false, "", false, errHTTPBadRequestDelayNoCache // FIXME error return false, false, "", false, errHTTPBadRequestDelayNoCache // FIXME error
} }
for i := range actions {
actions[i].ID = util.RandomString(10) // FIXME
}
m.Actions = actions m.Actions = actions
} }
unifiedpush = readBoolParam(r, false, "x-unifiedpush", "unifiedpush", "up") // see GET too! unifiedpush = readBoolParam(r, false, "x-unifiedpush", "unifiedpush", "up") // see GET too!

View File

@ -44,9 +44,13 @@ type attachment struct {
} }
type action struct { type action struct {
ID string `json:"id"`
Action string `json:"action"` Action string `json:"action"`
Label string `json:"label"` Label string `json:"label"`
URL string `json:"url,omitempty"` URL string `json:"url,omitempty"` // used in "view" and "http"
Method string `json:"method,omitempty"` // used in "http"
Headers map[string]string `json:"headers,omitempty"` // used in "http"
Body string `json:"body,omitempty"` // used in "http"
} }
// publishMessage is used as input when publishing as JSON // publishMessage is used as input when publishing as JSON