mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: Update upload security status on post move, topic conversion, category change (#8731)
Add TopicUploadSecurityManager to handle post moves. When a post moves around or a topic changes between categories and public/private message status the uploads connected to posts in the topic need to have their secure status updated, depending on the security context the topic now lives in.
This commit is contained in:
@ -217,6 +217,7 @@ describe PostCreator do
|
||||
Jobs.stubs(:enqueue).with(:feature_topic_users, has_key(:topic_id))
|
||||
Jobs.expects(:enqueue).with(:notify_mailing_list_subscribers, has_key(:post_id))
|
||||
Jobs.expects(:enqueue).with(:post_alert, has_key(:post_id))
|
||||
Jobs.expects(:enqueue).with(:update_topic_upload_security, has_key(:topic_id))
|
||||
Jobs.expects(:enqueue).with(:process_post, has_key(:invalidate_oneboxes))
|
||||
creator.opts[:invalidate_oneboxes] = true
|
||||
creator.create
|
||||
@ -226,6 +227,7 @@ describe PostCreator do
|
||||
Jobs.stubs(:enqueue).with(:feature_topic_users, has_key(:topic_id))
|
||||
Jobs.expects(:enqueue).with(:notify_mailing_list_subscribers, has_key(:post_id))
|
||||
Jobs.expects(:enqueue).with(:post_alert, has_key(:post_id))
|
||||
Jobs.expects(:enqueue).with(:update_topic_upload_security, has_key(:topic_id))
|
||||
Jobs.expects(:enqueue).with(:process_post, has_key(:image_sizes))
|
||||
creator.opts[:image_sizes] = { 'http://an.image.host/image.jpg' => { 'width' => 17, 'height' => 31 } }
|
||||
creator.create
|
||||
|
Reference in New Issue
Block a user