Revert "MM-42810: Introduce a channel hook for a websocket event (#23812)" (#24107)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2023-07-24 21:46:57 +05:30
коммит произвёл GitHub
родитель e70abd6e0f
Коммит 29bd0c9357
8 изменённых файлов: 155 добавлений и 211 удалений

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

@@ -190,6 +190,18 @@ func (a *App) getEmbedsAndImages(c request.CTX, post *model.Post, isNewPost bool
return post
}
func (a *App) sanitizePostMetadataForUserAndChannel(c request.CTX, post *model.Post, previewedPost *model.PreviewPost, previewedChannel *model.Channel, userID string) *model.Post {
if post.Metadata == nil || len(post.Metadata.Embeds) == 0 || previewedPost == nil {
return post
}
if previewedChannel != nil && !a.HasPermissionToReadChannel(c, userID, previewedChannel) {
post.Metadata.Embeds[0].Data = nil
}
return post
}
func (a *App) SanitizePostMetadataForUser(c request.CTX, post *model.Post, userID string) (*model.Post, *model.AppError) {
if post.Metadata == nil || len(post.Metadata.Embeds) == 0 {
return post, nil