diff --git a/static/js/notifications.js b/static/js/notifications.js index 8c8ceeaffd..f5269aee51 100644 --- a/static/js/notifications.js +++ b/static/js/notifications.js @@ -400,7 +400,7 @@ function should_send_desktop_notification(message) { // For streams, send if desktop notifications are enabled for this // stream. if ((message.type === "stream") && - subs.receives_desktop_notifications(message.stream)) { + stream_data.receives_desktop_notifications(message.stream)) { return true; } @@ -429,7 +429,7 @@ function should_send_desktop_notification(message) { function should_send_audible_notification(message) { // For streams, ding if sounds are enabled for this stream. if ((message.type === "stream") && - subs.receives_audible_notifications(message.stream)) { + stream_data.receives_audible_notifications(message.stream)) { return true; } diff --git a/static/js/stream_data.js b/static/js/stream_data.js index 39a080e91e..ad7fafbc3a 100644 --- a/static/js/stream_data.js +++ b/static/js/stream_data.js @@ -193,6 +193,22 @@ exports.create_sub_from_server_data = function (stream_name, attrs) { return sub; }; +exports.receives_desktop_notifications = function (stream_name) { + var sub = exports.get_sub(stream_name); + if (sub === undefined) { + return false; + } + return sub.desktop_notifications; +}; + +exports.receives_audible_notifications = function (stream_name) { + var sub = exports.get_sub(stream_name); + if (sub === undefined) { + return false; + } + return sub.audible_notifications; +}; + return exports; }()); diff --git a/static/js/subs.js b/static/js/subs.js index d6bca6c11f..9c89462b75 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -381,22 +381,6 @@ exports.pin_or_unpin_stream = function (stream_name) { } }; -exports.receives_desktop_notifications = function (stream_name) { - var sub = stream_data.get_sub(stream_name); - if (sub === undefined) { - return false; - } - return sub.desktop_notifications; -}; - -exports.receives_audible_notifications = function (stream_name) { - var sub = stream_data.get_sub(stream_name); - if (sub === undefined) { - return false; - } - return sub.audible_notifications; -}; - function populate_subscriptions(subs, subscribed) { var sub_rows = []; subs.sort(function (a, b) {