merefield
(Robert)
5 december 2020 om 21:39
4
Some avenues to explore:
The Cooked Post Processor enqueues a job to do this, see:
uri.query = query.map { |k, v| "#{k}=#{v}" }.join("&").presence
a["href"] = uri.to_s
end
end
def enforce_nofollow
add_nofollow = !@omit_nofollow && SiteSetting.add_rel_nofollow_to_user_content
PrettyText.add_rel_attributes_to_user_content(@doc, add_nofollow)
end
def pull_hotlinked_images
return if @opts[:skip_pull_hotlinked_images]
# have we enough disk space?
disable_if_low_on_disk_space # But still enqueue the job
# make sure no other job is scheduled
Jobs.cancel_scheduled_job(:pull_hotlinked_images, post_id: @post.id)
# schedule the job
delay = SiteSetting.editing_grace_period + 1
Jobs.enqueue_in(delay.seconds.to_i, :pull_hotlinked_images, post_id: @post.id)
end
The jobs code is here: discourse/app/jobs/regular/pull_hotlinked_images.rb at e98c7b15d6ce864f1b5e83b6881700eaa808bdd1 · discourse/discourse · GitHub
If you’ve managed to return the hotlinked images to the post, the images meet the criteria and settings ensure external images are uploaded, this should work.
Criteria here: discourse/lib/cooked_post_processor.rb at e98c7b15d6ce864f1b5e83b6881700eaa808bdd1 · discourse/discourse · GitHub
If this is not working yet but you are successfully showing the external images in the onebox, my hunch is the images don’t meet the criteria to be uploaded.