mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 05:58:25 +00:00
Fix fading of messages in dialog and users in side-bar.
Make comparison of emails in compose_fade.js and util.js case-insensitive to fix fading of users and messages respectively.
This commit is contained in:
@@ -61,7 +61,7 @@ var _ = global._;
|
|||||||
{type: 'private', reply_to: 'fred@zulip.com,melissa@zulip.com'}
|
{type: 'private', reply_to: 'fred@zulip.com,melissa@zulip.com'}
|
||||||
));
|
));
|
||||||
|
|
||||||
assert(!same(
|
assert(same(
|
||||||
{type: 'private', reply_to: 'fred@zulip.com'},
|
{type: 'private', reply_to: 'fred@zulip.com'},
|
||||||
{type: 'private', reply_to: 'Fred@zulip.com'}
|
{type: 'private', reply_to: 'Fred@zulip.com'}
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ exports.would_receive_message = function (email) {
|
|||||||
// helpful if we want to emphasize the '.unfaded' class later (applied
|
// helpful if we want to emphasize the '.unfaded' class later (applied
|
||||||
// to users who will definitely receive the message).
|
// to users who will definitely receive the message).
|
||||||
|
|
||||||
if (email === page_params.email) {
|
if (email.toLowerCase() === page_params.email.toLowerCase()) {
|
||||||
// We never want to fade you yourself, so pretend it's true even if
|
// We never want to fade you yourself, so pretend it's true even if
|
||||||
// it's not.
|
// it's not.
|
||||||
return true;
|
return true;
|
||||||
@@ -121,8 +121,8 @@ exports.would_receive_message = function (email) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PM, so check if the given email is in the recipients list.
|
// PM, so check if the given email is in the recipients list.
|
||||||
var recipients = focused_recipient.reply_to.split(',');
|
var recipients = focused_recipient.reply_to.toLowerCase().split(',');
|
||||||
return recipients.indexOf(email) !== -1;
|
return recipients.indexOf(email.toLowerCase()) !== -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
function _fade_users() {
|
function _fade_users() {
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ exports.same_major_recipient = function (a, b) {
|
|||||||
|
|
||||||
switch (a.type) {
|
switch (a.type) {
|
||||||
case 'private':
|
case 'private':
|
||||||
return a.reply_to === b.reply_to;
|
return a.reply_to.toLowerCase() === b.reply_to.toLowerCase();
|
||||||
case 'stream':
|
case 'stream':
|
||||||
return a.stream.toLowerCase() === b.stream.toLowerCase();
|
return a.stream.toLowerCase() === b.stream.toLowerCase();
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ exports.same_recipient = function util_same_recipient(a, b) {
|
|||||||
|
|
||||||
switch (a.type) {
|
switch (a.type) {
|
||||||
case 'private':
|
case 'private':
|
||||||
return a.reply_to === b.reply_to;
|
return a.reply_to.toLowerCase() === b.reply_to.toLowerCase();
|
||||||
case 'stream':
|
case 'stream':
|
||||||
return exports.same_stream_and_subject(a, b);
|
return exports.same_stream_and_subject(a, b);
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ exports.same_recipient = function util_same_recipient(a, b) {
|
|||||||
|
|
||||||
exports.same_sender = function util_same_sender(a, b) {
|
exports.same_sender = function util_same_sender(a, b) {
|
||||||
return ((a !== undefined) && (b !== undefined) &&
|
return ((a !== undefined) && (b !== undefined) &&
|
||||||
(a.sender_email === b.sender_email));
|
(a.sender_email.toLowerCase() === b.sender_email.toLowerCase()));
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.normalize_recipients = function (recipients) {
|
exports.normalize_recipients = function (recipients) {
|
||||||
|
|||||||
Reference in New Issue
Block a user