From 6e00c9ca3d4707f353349e2679e2ffbeb646f221 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 8 Apr 2013 11:58:29 -0400 Subject: [PATCH] util: Compare recipient streams by name, not recipient id. This is more consistent with how we compare subjects etc., and can be used for comparing the subjects of a potential future message that doesn't have a recipient id yet. (imported from commit 93251c62dc74b3f12c6140b12fc8d6c756d35f37) --- zephyr/static/js/compose.js | 2 +- zephyr/static/js/util.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/zephyr/static/js/compose.js b/zephyr/static/js/compose.js index 16a7be1eaf..44845b44d9 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.recipient_id = reply_message.recipient_id; + faded_to.display_recipient = reply_message.display_recipient; faded_to.subject = reply_message.subject; } else { faded_to.reply_to = reply_message.reply_to; diff --git a/zephyr/static/js/util.js b/zephyr/static/js/util.js index 1f957462fd..7808841919 100644 --- a/zephyr/static/js/util.js +++ b/zephyr/static/js/util.js @@ -166,9 +166,8 @@ 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. Streams have - // already been forced to the canonical case. - return ((a.recipient_id === b.recipient_id) && + // Streams and subjects are case-insensitive. + return ((a.display_recipient.toLowerCase() === b.display_recipient.toLowerCase()) && (a.subject.toLowerCase() === b.subject.toLowerCase())); };