mirror of
https://github.com/zulip/zulip.git
synced 2025-11-22 07:21:23 +00:00
settings: Add option to disable websockets.
This can be useful in scenarios where the network doesn't support websockets. We don't include it in prod_settings_template.py since it's a very rare setting to need. Fixes #1528.
This commit is contained in:
committed by
Tim Abbott
parent
84765e48a9
commit
e6e11aefb3
@@ -442,7 +442,7 @@ function report_send_time(send_time, receive_time, display_time, locally_echoed,
|
||||
}
|
||||
|
||||
var socket;
|
||||
if (feature_flags.use_socket) {
|
||||
if (page_params.use_socket) {
|
||||
socket = new Socket("/sockjs");
|
||||
}
|
||||
// For debugging. The socket will eventually move out of this file anyway.
|
||||
@@ -555,7 +555,7 @@ exports.send_message_success = function (local_id, message_id, start_time, local
|
||||
|
||||
exports.transmit_message = function (request, success, error) {
|
||||
delete exports.send_times_data[request.id];
|
||||
if (feature_flags.use_socket) {
|
||||
if (page_params.use_socket) {
|
||||
send_message_socket(request, success, error);
|
||||
} else {
|
||||
send_message_ajax(request, success, error);
|
||||
|
||||
@@ -5,7 +5,6 @@ var exports = {};
|
||||
// Manually-flipped debugging flags
|
||||
exports.log_send_times = false;
|
||||
exports.collect_send_times = false;
|
||||
exports.use_socket = true;
|
||||
exports.local_echo = true;
|
||||
|
||||
// Experimental modification to support much wider message views.
|
||||
|
||||
@@ -1861,6 +1861,7 @@ class HomeTest(ZulipTestCase):
|
||||
"twenty_four_hour_time",
|
||||
"unread_count",
|
||||
"unsubbed_info",
|
||||
"use_websockets",
|
||||
"user_id",
|
||||
"zulip_version",
|
||||
]
|
||||
|
||||
@@ -605,6 +605,7 @@ def home_real(request):
|
||||
prompt_for_invites = prompt_for_invites,
|
||||
notifications_stream = notifications_stream,
|
||||
cross_realm_bots = list(get_cross_realm_dicts()),
|
||||
use_websockets = settings.USE_WEBSOCKETS,
|
||||
|
||||
# Stream message notification settings:
|
||||
stream_desktop_notifications_enabled = user_profile.enable_stream_desktop_notifications,
|
||||
|
||||
@@ -181,6 +181,7 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
|
||||
'USING_PGROONGA': False,
|
||||
'POST_MIGRATION_CACHE_FLUSHING': False,
|
||||
'ENABLE_FILE_LINKS': False,
|
||||
'USE_WEBSOCKETS': True,
|
||||
}
|
||||
|
||||
for setting_name, setting_val in six.iteritems(DEFAULT_SETTINGS):
|
||||
|
||||
Reference in New Issue
Block a user