mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
home: Get enable_stream_desktop_notifications from register_ret.
This commit is contained in:
@@ -49,7 +49,7 @@ i18n.init({
|
|||||||
avatar_url: "http://example.com",
|
avatar_url: "http://example.com",
|
||||||
left_side_userlist: false,
|
left_side_userlist: false,
|
||||||
twenty_four_hour_time: false,
|
twenty_four_hour_time: false,
|
||||||
stream_desktop_notifications_enabled: false,
|
enable_stream_desktop_notifications: false,
|
||||||
enable_stream_sounds: false,
|
enable_stream_sounds: false,
|
||||||
desktop_notifications_enabled: false,
|
desktop_notifications_enabled: false,
|
||||||
enable_sounds: false,
|
enable_sounds: false,
|
||||||
|
|||||||
@@ -779,7 +779,7 @@ function render(template_name, args) {
|
|||||||
|
|
||||||
(function settings_tab() {
|
(function settings_tab() {
|
||||||
var page_param_checkbox_options = {
|
var page_param_checkbox_options = {
|
||||||
stream_desktop_notifications_enabled: true,
|
enable_stream_desktop_notifications: true,
|
||||||
enable_stream_sounds: true, desktop_notifications_enabled: true,
|
enable_stream_sounds: true, desktop_notifications_enabled: true,
|
||||||
enable_sounds: true, enable_offline_email_notifications: true,
|
enable_sounds: true, enable_offline_email_notifications: true,
|
||||||
enable_offline_push_notifications: true, enable_online_push_notifications: true,
|
enable_offline_push_notifications: true, enable_online_push_notifications: true,
|
||||||
|
|||||||
@@ -636,7 +636,7 @@ exports.handle_global_notification_updates = function (notification_name, settin
|
|||||||
// for a given message. These settings do not affect whether or not a
|
// for a given message. These settings do not affect whether or not a
|
||||||
// particular stream should receive notifications.
|
// particular stream should receive notifications.
|
||||||
if (notification_name === "enable_stream_desktop_notifications") {
|
if (notification_name === "enable_stream_desktop_notifications") {
|
||||||
page_params.stream_desktop_notifications_enabled = setting;
|
page_params.enable_stream_desktop_notifications = setting;
|
||||||
} else if (notification_name === "enable_stream_sounds") {
|
} else if (notification_name === "enable_stream_sounds") {
|
||||||
page_params.enable_stream_sounds = setting;
|
page_params.enable_stream_sounds = setting;
|
||||||
} else if (notification_name === "enable_desktop_notifications") {
|
} else if (notification_name === "enable_desktop_notifications") {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ exports.set_up = function () {
|
|||||||
// Stream notification settings.
|
// Stream notification settings.
|
||||||
|
|
||||||
if (result.enable_stream_desktop_notifications !== undefined) {
|
if (result.enable_stream_desktop_notifications !== undefined) {
|
||||||
page_params.stream_desktop_notifications_enabled =
|
page_params.enable_stream_desktop_notifications =
|
||||||
result.enable_stream_desktop_notifications;
|
result.enable_stream_desktop_notifications;
|
||||||
}
|
}
|
||||||
if (result.enable_stream_sounds !== undefined) {
|
if (result.enable_stream_sounds !== undefined) {
|
||||||
@@ -142,7 +142,7 @@ exports.set_up = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function _update_page() {
|
function _update_page() {
|
||||||
$("#enable_stream_desktop_notifications").prop('checked', page_params.stream_desktop_notifications_enabled);
|
$("#enable_stream_desktop_notifications").prop('checked', page_params.enable_stream_desktop_notifications);
|
||||||
$("#enable_stream_sounds").prop('checked', page_params.enable_stream_sounds);
|
$("#enable_stream_sounds").prop('checked', page_params.enable_stream_sounds);
|
||||||
$("#enable_desktop_notifications").prop('checked', page_params.desktop_notifications_enabled);
|
$("#enable_desktop_notifications").prop('checked', page_params.desktop_notifications_enabled);
|
||||||
$("#enable_sounds").prop('checked', page_params.enable_sounds);
|
$("#enable_sounds").prop('checked', page_params.enable_sounds);
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ exports.create_sub_from_server_data = function (stream_name, attrs) {
|
|||||||
newly_subscribed: false,
|
newly_subscribed: false,
|
||||||
in_home_view: true,
|
in_home_view: true,
|
||||||
invite_only: false,
|
invite_only: false,
|
||||||
desktop_notifications: page_params.stream_desktop_notifications_enabled,
|
desktop_notifications: page_params.enable_stream_desktop_notifications,
|
||||||
audible_notifications: page_params.enable_stream_sounds,
|
audible_notifications: page_params.enable_stream_sounds,
|
||||||
description: '',
|
description: '',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input type="checkbox" class="inline-block" name="enable_stream_desktop_notifications"
|
<input type="checkbox" class="inline-block" name="enable_stream_desktop_notifications"
|
||||||
id="enable_stream_desktop_notifications"
|
id="enable_stream_desktop_notifications"
|
||||||
{{#if page_params.stream_desktop_notifications_enabled}}
|
{{#if page_params.enable_stream_desktop_notifications}}
|
||||||
checked="checked"
|
checked="checked"
|
||||||
{{/if}} />
|
{{/if}} />
|
||||||
<span></span>
|
<span></span>
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ class HomeTest(ZulipTestCase):
|
|||||||
"enable_offline_push_notifications",
|
"enable_offline_push_notifications",
|
||||||
"enable_online_push_notifications",
|
"enable_online_push_notifications",
|
||||||
"enable_sounds",
|
"enable_sounds",
|
||||||
|
"enable_stream_desktop_notifications",
|
||||||
"enable_stream_sounds",
|
"enable_stream_sounds",
|
||||||
"enter_sends",
|
"enter_sends",
|
||||||
"first_in_realm",
|
"first_in_realm",
|
||||||
@@ -133,7 +134,6 @@ class HomeTest(ZulipTestCase):
|
|||||||
"server_inline_url_embed_preview",
|
"server_inline_url_embed_preview",
|
||||||
"server_uri",
|
"server_uri",
|
||||||
"share_the_love",
|
"share_the_love",
|
||||||
"stream_desktop_notifications_enabled",
|
|
||||||
"subscriptions",
|
"subscriptions",
|
||||||
"test_suite",
|
"test_suite",
|
||||||
"timezone",
|
"timezone",
|
||||||
|
|||||||
@@ -222,9 +222,6 @@ def home_real(request):
|
|||||||
avatar_url_medium = avatar_url(user_profile, medium=True),
|
avatar_url_medium = avatar_url(user_profile, medium=True),
|
||||||
avatar_source = user_profile.avatar_source,
|
avatar_source = user_profile.avatar_source,
|
||||||
|
|
||||||
# Stream message notification settings:
|
|
||||||
stream_desktop_notifications_enabled = user_profile.enable_stream_desktop_notifications,
|
|
||||||
|
|
||||||
# Private message and @-mention notification settings:
|
# Private message and @-mention notification settings:
|
||||||
desktop_notifications_enabled = desktop_notifications_enabled,
|
desktop_notifications_enabled = desktop_notifications_enabled,
|
||||||
pm_content_in_desktop_notifications = user_profile.pm_content_in_desktop_notifications,
|
pm_content_in_desktop_notifications = user_profile.pm_content_in_desktop_notifications,
|
||||||
@@ -264,6 +261,7 @@ def home_real(request):
|
|||||||
'enable_offline_push_notifications',
|
'enable_offline_push_notifications',
|
||||||
'enable_online_push_notifications',
|
'enable_online_push_notifications',
|
||||||
'enable_sounds',
|
'enable_sounds',
|
||||||
|
'enable_stream_desktop_notifications',
|
||||||
'enable_stream_sounds',
|
'enable_stream_sounds',
|
||||||
'hotspots',
|
'hotspots',
|
||||||
'last_event_id',
|
'last_event_id',
|
||||||
|
|||||||
Reference in New Issue
Block a user