PLT-6108 adding extra params to push notifications (#6236)

* PLT-6108 adding extra params to push notifications

* PLT-6108 adding extra params to push notifications
Этот коммит содержится в:
Corey Hulen
2017-04-26 07:29:50 -07:00
коммит произвёл GitHub
родитель 41dbb72946
Коммит 3e73adceb5
2 изменённых файлов: 18 добавлений и 0 удалений

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

@@ -487,10 +487,24 @@ func sendPushNotification(post *model.Post, user *model.User, channel *model.Cha
} else {
msg.Badge = int(badge.Data.(int64))
}
msg.Type = model.PUSH_TYPE_MESSAGE
msg.TeamId = channel.TeamId
msg.ChannelId = channel.Id
msg.ChannelName = channel.Name
msg.UserId = user.Id
if ou, ok := post.Props["override_username"]; ok && ou != nil {
msg.OverrideUsername = ou.(string)
}
if oi, ok := post.Props["override_icon_url"]; ok && oi != nil {
msg.OverrideIconUrl = oi.(string)
}
if fw, ok := post.Props["from_webhook"]; ok && fw != nil {
msg.FromWebhook = fw.(string)
}
if *utils.Cfg.EmailSettings.PushNotificationContents == model.FULL_NOTIFICATION {
if channel.Type == model.CHANNEL_DIRECT {

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

@@ -36,6 +36,10 @@ type PushNotification struct {
ChannelId string `json:"channel_id"`
ChannelName string `json:"channel_name"`
Type string `json:"type"`
UserId string `json:"user_id"`
OverrideUsername string `json:"override_username"`
OverrideIconUrl string `json:"override_icon_url"`
FromWebhook string `json:"from_webhook"`
}
func (me *PushNotification) ToJson() string {