diff --git a/zephyr/static/js/compose.js b/zephyr/static/js/compose.js index 44845b44d9..2e984d36bb 100644 --- a/zephyr/static/js/compose.js +++ b/zephyr/static/js/compose.js @@ -143,7 +143,7 @@ function do_fade(reply_message, fade_type) { type: fade_type }; if (fade_type === "stream") { - faded_to.display_recipient = reply_message.display_recipient; + faded_to.stream = reply_message.stream; faded_to.subject = reply_message.subject; } else { faded_to.reply_to = reply_message.reply_to; diff --git a/zephyr/static/js/message_list.js b/zephyr/static/js/message_list.js index 49b5620f79..7e82908028 100644 --- a/zephyr/static/js/message_list.js +++ b/zephyr/static/js/message_list.js @@ -292,9 +292,9 @@ MessageList.prototype = { message.unsubscribed = false; if (message.include_bookend && message.historical !== prev.historical) { if (message.historical) { - message.unsubscribed = message.display_recipient; + message.unsubscribed = message.stream; } else { - message.subscribed = message.display_recipient; + message.subscribed = message.stream; } } } @@ -316,9 +316,9 @@ MessageList.prototype = { } if (message.is_stream) { - message.background_color = subs.get_color(message.display_recipient); + message.background_color = subs.get_color(message.stream); message.color_class = subs.get_color_class(message.background_color); - message.invite_only = subs.get_invite_only(message.display_recipient); + message.invite_only = subs.get_invite_only(message.stream); } message.contains_mention = notifications.speaking_at_me(message); diff --git a/zephyr/static/js/narrow.js b/zephyr/static/js/narrow.js index b3c7ec6a7c..a07a3299bd 100644 --- a/zephyr/static/js/narrow.js +++ b/zephyr/static/js/narrow.js @@ -192,7 +192,7 @@ exports.message_in_home = function (message) { return true; } - return exports.stream_in_home(message.display_recipient); + return exports.stream_in_home(message.stream); }; // Build a filter function from a list of operators. @@ -235,7 +235,7 @@ function build_filter(operators_mixed_case) { case 'stream': if ((message.type !== 'stream') || - (message.display_recipient.toLowerCase() !== operand)) + (message.stream.toLowerCase() !== operand)) return false; break; @@ -436,7 +436,7 @@ exports.by_subject = function (target_id) { return; } exports.activate([ - ['stream', original.display_recipient], + ['stream', original.stream], ['subject', original.subject] ], { then_select_id: target_id }); }; @@ -450,7 +450,7 @@ exports.by_recipient = function (target_id) { break; case 'stream': - exports.by('stream', message.display_recipient, { then_select_id: target_id }); + exports.by('stream', message.stream, { then_select_id: target_id }); break; } }; diff --git a/zephyr/static/js/notifications.js b/zephyr/static/js/notifications.js index c68c1b7bd8..bfb8e6b079 100644 --- a/zephyr/static/js/notifications.js +++ b/zephyr/static/js/notifications.js @@ -103,7 +103,7 @@ function process_desktop_notification(message) { other_recipients = other_recipients.replace(message.sender_full_name + ", ", ""); } else { key = message.sender_full_name + " to " + - message.display_recipient + " > " + message.subject; + message.stream + " > " + message.subject; } if (content.length > 150) { @@ -138,7 +138,7 @@ function process_desktop_notification(message) { title += " (to you and " + other_recipients + ")"; } if (message.type === "stream") { - title += " (to " + message.display_recipient + " > " + message.subject + ")"; + title += " (to " + message.stream + " > " + message.subject + ")"; } notice_memory[key] = { @@ -197,7 +197,7 @@ function should_show_notification(message) { (message.type === "private" || exports.speaking_at_me(message) || (message.type === "stream" && - subs.receives_notifications(message.display_recipient))); + subs.receives_notifications(message.stream))); } exports.received_messages = function (messages) { diff --git a/zephyr/static/js/util.js b/zephyr/static/js/util.js index 7808841919..3bcd52b83a 100644 --- a/zephyr/static/js/util.js +++ b/zephyr/static/js/util.js @@ -167,7 +167,7 @@ exports.lower_bound = function (array, arg1, arg2, arg3, arg4) { exports.same_stream_and_subject = function util_same_stream_and_subject(a, b) { // Streams and subjects are case-insensitive. - return ((a.display_recipient.toLowerCase() === b.display_recipient.toLowerCase()) && + return ((a.stream.toLowerCase() === b.stream.toLowerCase()) && (a.subject.toLowerCase() === b.subject.toLowerCase())); }; diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index 53cf7b291f..3c169f259f 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -181,7 +181,7 @@ function respond_to_message(reply_type) { var stream = ''; var subject = ''; if (message.type === "stream") { - stream = message.display_recipient; + stream = message.stream; subject = message.subject; } @@ -320,7 +320,7 @@ function mark_all_as_read(cont) { function unread_hashkey(message) { var hashkey; if (message.type === 'stream') { - hashkey = message.display_recipient; + hashkey = message.stream; } else { hashkey = message.display_reply_to; } @@ -469,11 +469,11 @@ function process_message_for_recent_subjects(message) { var current_timestamp = 0; var max_subjects = 5; - if (! recent_subjects.hasOwnProperty(message.display_recipient)) { - recent_subjects[message.display_recipient] = []; + if (! recent_subjects.hasOwnProperty(message.stream)) { + recent_subjects[message.stream] = []; } else { - recent_subjects[message.display_recipient] = - $.grep(recent_subjects[message.display_recipient], function (item) { + recent_subjects[message.stream] = + $.grep(recent_subjects[message.stream], function (item) { if (item.subject === message.subject) { current_timestamp = item.timestamp; } @@ -482,7 +482,7 @@ function process_message_for_recent_subjects(message) { }); } - var recents = recent_subjects[message.display_recipient]; + var recents = recent_subjects[message.stream]; recents.push({subject: message.subject, timestamp: Math.max(message.timestamp, current_timestamp)}); @@ -492,7 +492,7 @@ function process_message_for_recent_subjects(message) { recents = recents.slice(0, max_subjects); - recent_subjects[message.display_recipient] = recents; + recent_subjects[message.stream] = recents; update_recent_subjects(); } @@ -512,12 +512,13 @@ function add_message_metadata(message, dummy) { switch (message.type) { case 'stream': message.is_stream = true; - if (! subject_dict.hasOwnProperty(message.display_recipient)) { - subject_dict[message.display_recipient] = []; + message.stream = message.display_recipient; + if (! subject_dict.hasOwnProperty(message.stream)) { + subject_dict[message.stream] = []; } - if (! case_insensitive_find(message.subject, subject_dict[message.display_recipient])) { - subject_dict[message.display_recipient].push(message.subject); - subject_dict[message.display_recipient].sort(); + if (! case_insensitive_find(message.subject, subject_dict[message.stream])) { + subject_dict[message.stream].push(message.subject); + subject_dict[message.stream].sort(); // We don't need to update the autocomplete after this because // the subject box's source is a function } diff --git a/zephyr/static/templates/actions_popover_content.handlebars b/zephyr/static/templates/actions_popover_content.handlebars index 711da0a319..8630a8d8ef 100644 --- a/zephyr/static/templates/actions_popover_content.handlebars +++ b/zephyr/static/templates/actions_popover_content.handlebars @@ -17,7 +17,7 @@ {{#if message.is_stream}} - Reply to this subject on stream {{message.display_recipient}} + Reply to this subject on stream {{message.stream}} {{else}} Reply to this private message {{/if}} @@ -35,7 +35,7 @@
  • - Narrow to this subject on stream {{message.display_recipient}} + Narrow to this subject on stream {{message.stream}}
  • {{else}} diff --git a/zephyr/static/templates/actions_popover_title.handlebars b/zephyr/static/templates/actions_popover_title.handlebars index 065d0e4499..5bdc423c14 100644 --- a/zephyr/static/templates/actions_popover_title.handlebars +++ b/zephyr/static/templates/actions_popover_title.handlebars @@ -1,6 +1,6 @@ {{! Title of the "message actions" popup }} {{#if message.is_stream}} -Message to stream {{message.display_recipient}} +Message to stream {{message.stream}} {{else}} Private message {{/if}}