settings: Add option to control Jitsi video chat integration.

Fixes #8922.
This commit is contained in:
Tim Abbott 2018-04-02 16:46:55 -07:00
parent e792fc6c07
commit 938c4cee08
8 changed files with 21 additions and 1 deletions

View File

@ -1227,6 +1227,8 @@ function test_raw_file_drop(raw_drop_func) {
}());
(function test_video_link_compose_clicked() {
page_params.jitsi_server_url = 'https://meet.jit.si';
var syntax_to_insert;
compose_ui.insert_syntax_and_focus = function (syntax) {

View File

@ -905,8 +905,12 @@ exports.initialize = function () {
$('#compose').on('click', '#video_link', function (e) {
e.preventDefault();
if (page_params.jitsi_server_url === null) {
return;
}
var video_call_id = util.random_int(100000000000000, 999999999999999);
var video_call_link = 'https://meet.jit.si/' + video_call_id;
var video_call_link = page_params.jitsi_server_url + "/" + video_call_id;
var video_call_link_text = '[' + _('Click to join video call') + '](' + video_call_link + ')';
compose_ui.insert_syntax_and_focus(video_call_link_text);
});

View File

@ -109,8 +109,10 @@
id="attach_dropbox_files" href="#" title="{{ _('Attach files from Dropbox') }}"></a>
<a class="message-control-button icon-vector-paper-clip notdisplayed"
id="attach_files" href="#" title="{{ _('Attach files') }}"></a>
{% if jitsi_server_url %}
<a class="message-control-button fa fa-video-camera"
id="video_link" href="#" title="{{ _('Add video call') }}"></a>
{% endif %}
<a id="undo_markdown_preview"
class="message-control-button icon-vector-edit"
style="display:none;" title="{{ _('Write') }}"></a>

View File

@ -128,6 +128,7 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
'find_team_link_disabled': find_team_link_disabled,
'password_min_length': settings.PASSWORD_MIN_LENGTH,
'password_min_guesses': settings.PASSWORD_MIN_GUESSES,
'jitsi_server_url': settings.JITSI_SERVER_URL,
'zulip_version': ZULIP_VERSION,
'user_is_authenticated': user_is_authenticated,
'settings_path': settings_path,

View File

@ -81,6 +81,7 @@ class HomeTest(ZulipTestCase):
"hotspots",
"initial_servertime",
"is_admin",
"jitsi_server_url",
"language_list",
"language_list_dbl_col",
"last_event_id",

View File

@ -190,6 +190,7 @@ def home_real(request: HttpRequest) -> HttpResponse:
server_inline_url_embed_preview = settings.INLINE_URL_EMBED_PREVIEW,
password_min_length = settings.PASSWORD_MIN_LENGTH,
password_min_guesses = settings.PASSWORD_MIN_GUESSES,
jitsi_server_url = settings.JITSI_SERVER_URL,
# Misc. extra data.
have_initial_messages = user_has_messages,

View File

@ -453,3 +453,9 @@ CAMO_URI = '/external_content/'
# Controls whether Zulip will rate-limit user requests.
# RATE_LIMITING = True
# Controls the Jitsi video call integration. By default, the
# integration uses the SaaS meet.jit.si server. You can specify
# your own Jitsi Meet server, or if you'd like to disable the
# integration, set JITSI_SERVER_URL = None.
#JITSI_SERVER_URL = 'jitsi.example.com'

View File

@ -160,6 +160,9 @@ DEFAULT_SETTINGS = {
'LOCAL_UPLOADS_DIR': None,
'MAX_FILE_UPLOAD_SIZE': 25,
# JITSI video call integration; set to None to disable integration.
'JITSI_SERVER_URL': 'https://meet.jit.si/',
# Feedback bot settings
'ENABLE_FEEDBACK': PRODUCTION,
'FEEDBACK_EMAIL': None,