revert default ephemeral post message for out of channel mention (#8571)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0ab47cf145
Коммит
1476ca5b2d
@@ -99,7 +99,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
|
|||||||
outOfChannelMentions := result.Data.([]*model.User)
|
outOfChannelMentions := result.Data.([]*model.User)
|
||||||
if channel.Type != model.CHANNEL_GROUP {
|
if channel.Type != model.CHANNEL_GROUP {
|
||||||
a.Go(func() {
|
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 {
|
if len(users) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -772,25 +772,16 @@ func (a *App) sendOutOfChannelMentions(sender *model.User, post *model.Post, cha
|
|||||||
|
|
||||||
T := utils.GetUserTranslations(sender.Locale)
|
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()
|
ephemeralPostId := model.NewId()
|
||||||
var message string
|
var message string
|
||||||
if len(users) == 1 {
|
if len(users) == 1 {
|
||||||
message = T("api.post.check_for_out_of_channel_mentions.message.one", map[string]interface{}{
|
message = T("api.post.check_for_out_of_channel_mentions.message.one", map[string]interface{}{
|
||||||
"Username": usernames[0],
|
"Username": usernames[0],
|
||||||
"Phrase": localePhrase,
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
message = T("api.post.check_for_out_of_channel_mentions.message.multiple", map[string]interface{}{
|
message = T("api.post.check_for_out_of_channel_mentions.message.multiple", map[string]interface{}{
|
||||||
"Usernames": strings.Join(usernames[:len(usernames)-1], ", @"),
|
"Usernames": strings.Join(usernames[:len(usernames)-1], ", @"),
|
||||||
"LastUsername": usernames[len(usernames)-1],
|
"LastUsername": usernames[len(usernames)-1],
|
||||||
"Phrase": localePhrase,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
i18n/en.json
12
i18n/en.json
@@ -1696,21 +1696,13 @@
|
|||||||
"id": "api.plugin.upload.no_file.app_error",
|
"id": "api.plugin.upload.no_file.app_error",
|
||||||
"translation": "Missing file in multipart/form request"
|
"translation": "Missing file in multipart/form request"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "api.post.check_for_out_of_channel_mentions.link.private",
|
|
||||||
"translation": "add them to this private channel"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "api.post.check_for_out_of_channel_mentions.link.public",
|
|
||||||
"translation": "add them to the channel"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "api.post.check_for_out_of_channel_mentions.message.multiple",
|
"id": "api.post.check_for_out_of_channel_mentions.message.multiple",
|
||||||
"translation": "@{{.Usernames}} and @{{.LastUsername}} were mentioned but they are not in the channel. Would you like to {{.Phrase}}? They will have access to all message history."
|
"translation": "@{{.Usernames}} and @{{.LastUsername}} were mentioned, but they did not receive notifications because they do not belong to this channel."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.post.check_for_out_of_channel_mentions.message.one",
|
"id": "api.post.check_for_out_of_channel_mentions.message.one",
|
||||||
"translation": "@{{.Username}} was mentioned but they are not in the channel. Would you like to {{.Phrase}}? They will have access to all message history."
|
"translation": "@{{.Username}} was mentioned, but they did not receive notifications because they do not belong to this channel."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.post.create_post.attach_files.error",
|
"id": "api.post.create_post.attach_files.error",
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user