From 3e73adceb58e3a28bf3653b3e12a6a861643c400 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Wed, 26 Apr 2017 07:29:50 -0700 Subject: 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 --- app/notification.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/notification.go') diff --git a/app/notification.go b/app/notification.go index 195f808c7..8e7e43d55 100644 --- a/app/notification.go +++ b/app/notification.go @@ -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 { -- cgit v1.2.3-1-g7c22