summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-09-20 13:01:12 -0300
committerChristopher Speller <crspeller@gmail.com>2016-09-20 12:01:12 -0400
commit4e3d46521096a8f9a0b8b3461e0b1b44768c9e84 (patch)
treed3e1bec428c73475f6a6870fb0b67f7ee317a5c4 /api/post.go
parentf8108efe35ec5b7d362cbb3890a7acdc8884b0f6 (diff)
downloadchat-4e3d46521096a8f9a0b8b3461e0b1b44768c9e84.tar.gz
chat-4e3d46521096a8f9a0b8b3461e0b1b44768c9e84.tar.bz2
chat-4e3d46521096a8f9a0b8b3461e0b1b44768c9e84.zip
PLT-4179 send push notifications with override_username (#4040)
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/api/post.go b/api/post.go
index c43bc9843..0b43aef0d 100644
--- a/api/post.go
+++ b/api/post.go
@@ -678,7 +678,11 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *
if post.IsSystemMessage() {
senderName = c.T("system.message.name")
} else if profile, ok := profileMap[post.UserId]; ok {
- senderName = profile.Username
+ if value, ok := post.Props["override_username"]; ok && post.Props["from_webhook"] == "true" {
+ senderName = value.(string)
+ } else {
+ senderName = profile.Username
+ }
sender = profile
}