Fix push notification styling backwards compatibility (#8913)

Этот коммит содержится в:
Elias Nahum
2018-06-06 12:02:22 -04:00
коммит произвёл Carlos Tadeu Panato Junior
родитель 26f238af2a
Коммит 1d961b1632
2 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@@ -722,6 +722,7 @@ func (a *App) sendPushNotification(post *model.Post, user *model.User, channel *
msg.Badge = int(badge.Data.(int64)) msg.Badge = int(badge.Data.(int64))
} }
msg.Version = model.PUSH_MESSAGE_V2
msg.Type = model.PUSH_TYPE_MESSAGE msg.Type = model.PUSH_TYPE_MESSAGE
msg.TeamId = channel.TeamId msg.TeamId = channel.TeamId
msg.ChannelId = channel.Id msg.ChannelId = channel.Id

Просмотреть файл

@@ -17,6 +17,7 @@ const (
PUSH_TYPE_MESSAGE = "message" PUSH_TYPE_MESSAGE = "message"
PUSH_TYPE_CLEAR = "clear" PUSH_TYPE_CLEAR = "clear"
PUSH_MESSAGE_V2 = "v2"
// The category is set to handle a set of interactive Actions // The category is set to handle a set of interactive Actions
// with the push notifications // with the push notifications
@@ -44,6 +45,7 @@ type PushNotification struct {
OverrideUsername string `json:"override_username"` OverrideUsername string `json:"override_username"`
OverrideIconUrl string `json:"override_icon_url"` OverrideIconUrl string `json:"override_icon_url"`
FromWebhook string `json:"from_webhook"` FromWebhook string `json:"from_webhook"`
Version string `json:"version"`
} }
func (me *PushNotification) ToJson() string { func (me *PushNotification) ToJson() string {