mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
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:
@@ -1,6 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from six import text_type
|
||||
from typing import Any, Dict, Optional, Text
|
||||
import ujson
|
||||
|
||||
@@ -191,3 +192,10 @@ def twitter(tweet_id):
|
||||
return ujson.loads(MEDIA_TWEET)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def fake_urlembed_data():
|
||||
# type: () -> Dict[text_type, text_type]
|
||||
return {
|
||||
'title': 'Test',
|
||||
'description': 'Short description'}
|
||||
|
||||
Reference in New Issue
Block a user