diff --git a/app/notification_push.go b/app/notification_push.go index b69b52aeac..58d2c2bd45 100644 --- a/app/notification_push.go +++ b/app/notification_push.go @@ -56,12 +56,6 @@ type PushNotification struct { func (a *App) sendPushNotificationSync(post *model.Post, user *model.User, channel *model.Channel, channelName string, senderName string, explicitMention bool, channelWideMention bool, replyToThreadType string) *model.AppError { cfg := a.Config() - message, err := utils.StripMarkdown(post.Message) - if err != nil { - mlog.Warn("Failed parse to markdown", mlog.String("post_id", post.Id), mlog.Err(err)) - } else { - post.Message = message - } msg, appErr := a.BuildPushNotificationMessage( *cfg.EmailSettings.PushNotificationContents, post, @@ -585,6 +579,12 @@ func (a *App) buildFullPushNotificationMessage(contentsConfig string, post *mode } postMessage := post.Message + stripped, err := utils.StripMarkdown(postMessage) + if err != nil { + mlog.Warn("Failed parse to markdown", mlog.String("post_id", post.Id), mlog.Err(err)) + } else { + postMessage = stripped + } for _, attachment := range post.Attachments() { if attachment.Fallback != "" { postMessage += "\n" + attachment.Fallback