summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-02-22 09:00:13 -0500
committerGitHub <noreply@github.com>2018-02-22 09:00:13 -0500
commit1b3808f3ecf754876168a9342e18c46d49f32ddf (patch)
treebf2fe8fe9f97a20bbd4ea43a90209a75e861eb6f /app/notification.go
parent342d05bcfcd8de642b254fe2316c2562482e39f7 (diff)
downloadchat-1b3808f3ecf754876168a9342e18c46d49f32ddf.tar.gz
chat-1b3808f3ecf754876168a9342e18c46d49f32ddf.tar.bz2
chat-1b3808f3ecf754876168a9342e18c46d49f32ddf.zip
Fix push notification content for file only messages (#8346)
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/notification.go b/app/notification.go
index 24e84500b..752e4bb12 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -623,7 +623,9 @@ func (a *App) getPushNotificationMessage(postMessage string, wasMentioned bool,
message := ""
category := ""
- if *a.Config().EmailSettings.PushNotificationContents == model.FULL_NOTIFICATION {
+ contentsConfig := *a.Config().EmailSettings.PushNotificationContents
+
+ if contentsConfig == model.FULL_NOTIFICATION {
category = model.CATEGORY_CAN_REPLY
if channelType == model.CHANNEL_DIRECT {
@@ -631,7 +633,7 @@ func (a *App) getPushNotificationMessage(postMessage string, wasMentioned bool,
} else {
message = senderName + userLocale("api.post.send_notifications_and_forget.push_in") + channelName + ": " + model.ClearMentionTags(postMessage)
}
- } else if *a.Config().EmailSettings.PushNotificationContents == model.GENERIC_NO_CHANNEL_NOTIFICATION {
+ } else if contentsConfig == model.GENERIC_NO_CHANNEL_NOTIFICATION {
if channelType == model.CHANNEL_DIRECT {
category = model.CATEGORY_CAN_REPLY
@@ -659,6 +661,8 @@ func (a *App) getPushNotificationMessage(postMessage string, wasMentioned bool,
if len(postMessage) == 0 && hasFiles {
if channelType == model.CHANNEL_DIRECT {
message = senderName + userLocale("api.post.send_notifications_and_forget.push_image_only_dm")
+ } else if contentsConfig == model.GENERIC_NO_CHANNEL_NOTIFICATION {
+ message = senderName + userLocale("api.post.send_notifications_and_forget.push_image_only_no_channel")
} else {
message = senderName + userLocale("api.post.send_notifications_and_forget.push_image_only") + channelName
}