E2E save draft

This commit is contained in:
Philipp Heckel 2022-08-18 11:50:58 -04:00
parent 466c9874a8
commit dafd62dc6b
3 changed files with 262 additions and 210 deletions

View file

@ -66,17 +66,17 @@ func newAction() *action {
// PublishMessage is used as input when publishing as JSON
type PublishMessage struct {
Topic string `json:"topic"`
Title string `json:"title"`
Message string `json:"message"`
Priority int `json:"priority"`
Tags []string `json:"tags"`
Click string `json:"click"`
Actions []action `json:"actions"`
Attach string `json:"attach"`
Filename string `json:"filename"`
Email string `json:"email"`
Delay string `json:"delay"`
Topic string `json:"topic"`
Title string `json:"title"`
Message string `json:"message"`
Priority int `json:"priority"`
Tags []string `json:"tags"`
Click string `json:"click"`
Actions []*action `json:"actions"`
Attach string `json:"attach"`
Filename string `json:"filename"`
Email string `json:"email"`
Delay string `json:"delay"`
}
// messageEncoder is a function that knows how to encode a message
@ -115,8 +115,8 @@ func newPollRequestMessage(topic, pollID string) *message {
return m
}
func newEncryptedMessage(topic string) *message {
m := newMessage(messageEvent, topic, "")
func newEncryptedMessage(topic, message string) *message {
m := newMessage(messageEvent, topic, message)
m.Encoding = encodingJWE
return m
}