Этот коммит содержится в:
Daniel Espino García
2023-12-01 10:50:57 +01:00
коммит произвёл GitHub
родитель a7f8347f01
Коммит f6d41bcf5b
2 изменённых файлов: 75 добавлений и 0 удалений

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

@@ -760,6 +760,17 @@ func (a *App) UpdatePost(c request.CTX, receivedUpdatedPost *model.Post, safeUpd
a.invalidateCacheForChannelPosts(rpost.ChannelId)
userID := c.Session().UserId
sanitizedPost, err := a.SanitizePostMetadataForUser(c, rpost, userID)
if err != nil {
mlog.Error("Failed to sanitize post metadata for user", mlog.String("user_id", userID), mlog.Err(err))
// If we failed to sanitize the post, we still want to remove the metadata.
sanitizedPost = rpost.Clone()
sanitizedPost.Metadata = nil
}
rpost = sanitizedPost
return rpost, nil
}