Add oembed/Open Graph/Meta tags data retrieval from inline links.

This change adds support for displaying inline open graph previews for
links posted into Zulip.

It is designed to interact correctly with message editing.

This adds the new settings.INLINE_URL_EMBED_PREVIEW setting to control
whether this feature is enabled.

By default, this setting is currently disabled, so that we can burn it
in for a bit before it impacts users more broadly.

Eventually, we may want to make this manageable via a (set of?)
per-realm settings.  E.g. I can imagine a realm wanting to be able to
enable/disable it for certain URLs.
This commit is contained in:
Igor Tokarev
2016-10-27 15:06:44 +05:00
committed by Tim Abbott
parent b68fef8933
commit c93f1d4eda
23 changed files with 464 additions and 14 deletions

View File

@@ -291,6 +291,7 @@ def render_markdown(message, content, domain=None, realm_alert_words=None, messa
message.is_me_message = False
message.mentions_user_ids = set()
message.alert_words = set()
message.links_for_preview = set()
if not domain:
domain = message.sender.realm.domain