MM-28984: Add fallback text to push notification (#16089)
We read the fallback text from message attachments and append that as part of a push notification. https://mattermost.atlassian.net/browse/MM-28984 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
165c4d2dd1
Коммит
27dbe9e182
@@ -164,7 +164,7 @@ func (a *App) getPushNotificationMessage(contentsConfig, postMessage string, exp
|
||||
senderName, channelName, channelType, replyToThreadType string, userLocale i18n.TranslateFunc) string {
|
||||
|
||||
// If the post only has images then push an appropriate message
|
||||
if len(postMessage) == 0 && hasFiles {
|
||||
if postMessage == "" && hasFiles {
|
||||
if channelType == model.CHANNEL_DIRECT {
|
||||
return strings.Trim(userLocale("api.post.send_notifications_and_forget.push_image_only"), " ")
|
||||
}
|
||||
@@ -582,6 +582,10 @@ func (a *App) buildFullPushNotificationMessage(contentsConfig string, post *mode
|
||||
msg.FromWebhook = fw
|
||||
}
|
||||
|
||||
for _, attachment := range post.Attachments() {
|
||||
post.Message += "\n" + attachment.Fallback
|
||||
}
|
||||
|
||||
userLocale := utils.GetUserTranslations(user.Locale)
|
||||
hasFiles := post.FileIds != nil && len(post.FileIds) > 0
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user