[MM-30980] Avoid modifying original post when sending a notification (#17697)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Miguel de la Cruz
2021-06-03 12:52:29 +02:00
коммит произвёл GitHub
родитель 3299a72adb
Коммит 42157fafa2
2 изменённых файлов: 13 добавлений и 5 удалений

Просмотреть файл

@@ -577,9 +577,10 @@ func (a *App) buildFullPushNotificationMessage(contentsConfig string, post *mode
msg.FromWebhook = fw
}
postMessage := post.Message
for _, attachment := range post.Attachments() {
if attachment.Fallback != "" {
post.Message += "\n" + attachment.Fallback
postMessage += "\n" + attachment.Fallback
}
}
@@ -588,7 +589,7 @@ func (a *App) buildFullPushNotificationMessage(contentsConfig string, post *mode
msg.Message = a.getPushNotificationMessage(
contentsConfig,
post.Message,
postMessage,
explicitMention,
channelWideMention,
hasFiles,