summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/notification.go14
-rw-r--r--model/push_notification.go4
2 files changed, 18 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 {
diff --git a/model/push_notification.go b/model/push_notification.go
index 49d4043eb..5131c033d 100644
--- a/model/push_notification.go
+++ b/model/push_notification.go
@@ -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 {