FEATURE: Review posts with media. (#10693)

To check if a post contains any embedded media, we look if the "image_sizes" attribute is present in the new post manager arguments.

We want to see one boxed links, but we only store the raw content of the post. To work around this, I extracted the onebox logic from the composer editor into a module.
This commit is contained in:
Roman Rizzi
2020-09-18 12:45:09 -03:00
committed by GitHub
parent f3156a6478
commit f85f73be88
8 changed files with 167 additions and 73 deletions

View File

@ -108,6 +108,11 @@ class NewPostManager
return :category if post_needs_approval_in_its_category?(manager)
return :contains_media if (
manager.args[:image_sizes].present? &&
user.trust_level < SiteSetting.review_media_unless_trust_level.to_i
)
:skip
end