summaryrefslogtreecommitdiffstats
path: root/app/notification.go
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2018-04-04 02:22:06 +0800
committerGitHub <noreply@github.com>2018-04-04 02:22:06 +0800
commit1476ca5b2d2430858f5cfe8206815ec659393609 (patch)
treea086e5a40859cffcbea7d2a86ac14a8b9b3d87c6 /app/notification.go
parent0ab47cf1455317d757567ff26c96b8ea1f57c838 (diff)
downloadchat-1476ca5b2d2430858f5cfe8206815ec659393609.tar.gz
chat-1476ca5b2d2430858f5cfe8206815ec659393609.tar.bz2
chat-1476ca5b2d2430858f5cfe8206815ec659393609.zip
revert default ephemeral post message for out of channel mention (#8571)
Diffstat (limited to 'app/notification.go')
-rw-r--r--app/notification.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/app/notification.go b/app/notification.go
index 6d0de2223..0ea03c9d9 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -99,7 +99,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
outOfChannelMentions := result.Data.([]*model.User)
if channel.Type != model.CHANNEL_GROUP {
a.Go(func() {
- a.sendOutOfChannelMentions(sender, post, channel.Type, outOfChannelMentions)
+ a.sendOutOfChannelMentions(sender, post, outOfChannelMentions)
})
}
}
@@ -754,7 +754,7 @@ func (a *App) getMobileAppSessions(userId string) ([]*model.Session, *model.AppE
}
}
-func (a *App) sendOutOfChannelMentions(sender *model.User, post *model.Post, channelType string, users []*model.User) *model.AppError {
+func (a *App) sendOutOfChannelMentions(sender *model.User, post *model.Post, users []*model.User) *model.AppError {
if len(users) == 0 {
return nil
}
@@ -772,25 +772,16 @@ func (a *App) sendOutOfChannelMentions(sender *model.User, post *model.Post, cha
T := utils.GetUserTranslations(sender.Locale)
- var localePhrase string
- if channelType == model.CHANNEL_OPEN {
- localePhrase = T("api.post.check_for_out_of_channel_mentions.link.public")
- } else if channelType == model.CHANNEL_PRIVATE {
- localePhrase = T("api.post.check_for_out_of_channel_mentions.link.private")
- }
-
ephemeralPostId := model.NewId()
var message string
if len(users) == 1 {
message = T("api.post.check_for_out_of_channel_mentions.message.one", map[string]interface{}{
"Username": usernames[0],
- "Phrase": localePhrase,
})
} else {
message = T("api.post.check_for_out_of_channel_mentions.message.multiple", map[string]interface{}{
"Usernames": strings.Join(usernames[:len(usernames)-1], ", @"),
"LastUsername": usernames[len(usernames)-1],
- "Phrase": localePhrase,
})
}