FIX: Improve Onebox detection (PR #8019)

Follow-up to 7c83d2eeb261ac676a8320e6a704752c56fd242e.

GitHub

You’ve signed the CLA, nbianca. Thank you! This pull request is ready for review.

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

Looks good, but the build is broken. Can you have a look?

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

Should we keep track of onebox_urls if Oneboxer.cached_onebox might fail later?

Why that change?

Some links were either in the raw_links array or in the @onebox_urls array, so link_count was returning only a partial count of the links present in the post.

@onebox_urls keeps all links that should be Oneboxed whether they succeed or not. It is used later to determine the number of links.