summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-04-26 07:29:50 -0700
committerGitHub <noreply@github.com>2017-04-26 07:29:50 -0700
commit3e73adceb58e3a28bf3653b3e12a6a861643c400 (patch)
tree63f3aa91197d241dfbfdd009f0dc47d063dad21a /app/notification.go
parent41dbb7294673e78361fbef7587258f0bdee7a0f8 (diff)
downloadchat-3e73adceb58e3a28bf3653b3e12a6a861643c400.tar.gz
chat-3e73adceb58e3a28bf3653b3e12a6a861643c400.tar.bz2
chat-3e73adceb58e3a28bf3653b3e12a6a861643c400.zip
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
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go14
1 files changed, 14 insertions, 0 deletions
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 {