mirror of https://github.com/zulip/zulip.git
Be case-insensitive about subjects when collapsing and narrowing.
(imported from commit 0baf20179c037c3eac82d8db20c6ec8062bb136a)
This commit is contained in:
parent
8752b3bf18
commit
a2c6975ca2
|
@ -47,7 +47,7 @@ var globals =
|
|||
|
||||
// zephyr.js
|
||||
+ ' message_array message_dict get_updates_params'
|
||||
+ ' clear_table add_to_table subject_dict'
|
||||
+ ' clear_table add_to_table subject_dict same_stream_and_subject'
|
||||
+ ' keep_pointer_in_view move_pointer_at_page_top_and_bottom'
|
||||
+ ' respond_to_message'
|
||||
+ ' select_message select_message_by_id'
|
||||
|
|
|
@ -107,9 +107,8 @@ exports.by_subject = function () {
|
|||
subject: original.subject
|
||||
};
|
||||
do_narrow(bar, function (other) {
|
||||
return (other.type === 'stream' &&
|
||||
original.recipient_id === other.recipient_id &&
|
||||
original.subject === other.subject);
|
||||
return ((other.type === 'stream') &&
|
||||
same_stream_and_subject(original, other));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -199,6 +199,13 @@ function select_message(next_message, opts) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function 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) &&
|
||||
(a.subject.toLowerCase() === b.subject.toLowerCase()));
|
||||
}
|
||||
|
||||
function same_recipient(a, b) {
|
||||
if ((a === undefined) || (b === undefined))
|
||||
return false;
|
||||
|
@ -211,8 +218,7 @@ function same_recipient(a, b) {
|
|||
case 'personal':
|
||||
return a.reply_to === b.reply_to;
|
||||
case 'stream':
|
||||
return (a.recipient_id === b.recipient_id) &&
|
||||
(a.subject === b.subject);
|
||||
return same_stream_and_subject(a, b);
|
||||
}
|
||||
|
||||
// should never get here
|
||||
|
|
Loading…
Reference in New Issue