feat: add redis cache and fanout support
This commit is contained in:
@@ -39,7 +39,7 @@ func payloadToData(pl *push.Payload) (map[string]string, error) {
|
||||
// Must use "xfrom" because "from" is a reserved word. Google did not bother to document it anywhere.
|
||||
data["xfrom"] = pl.From
|
||||
if pl.What == push.ActMsg {
|
||||
data["seq"] = strconv.Itoa(pl.SeqId)
|
||||
data["seq"] = strconv.FormatInt(pl.SeqId, 10)
|
||||
if pl.ContentType != "" {
|
||||
data["mime"] = pl.ContentType
|
||||
}
|
||||
@@ -81,7 +81,7 @@ func payloadToData(pl *push.Payload) (map[string]string, error) {
|
||||
data["modeWant"] = pl.ModeWant.String()
|
||||
data["modeGiven"] = pl.ModeGiven.String()
|
||||
} else if pl.What == push.ActRead {
|
||||
data["seq"] = strconv.Itoa(pl.SeqId)
|
||||
data["seq"] = strconv.FormatInt(pl.SeqId, 10)
|
||||
data["silent"] = "true"
|
||||
} else {
|
||||
return nil, errors.New("unknown push type")
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ type Payload struct {
|
||||
// Message sender 'usrXXX'
|
||||
From string `json:"from"`
|
||||
// Sequential ID of the message.
|
||||
SeqId int `json:"seq"`
|
||||
SeqId int64 `json:"seq"`
|
||||
// MIME-Type of the message content, text/x-drafty or text/plain
|
||||
ContentType string `json:"mime"`
|
||||
// Actual Data.Content of the message, if requested
|
||||
|
||||
Reference in New Issue
Block a user