mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
util: Create and use is_pm_recipient helper function.
This commit is contained in:
@@ -121,8 +121,7 @@ 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.toLowerCase().split(',');
|
return util.is_pm_recipient(email, focused_recipient);
|
||||||
return recipients.indexOf(email.toLowerCase()) !== -1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function _fade_users() {
|
function _fade_users() {
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ exports.is_current_user = function (email) {
|
|||||||
return email.toLowerCase() === page_params.email.toLowerCase();
|
return email.toLowerCase() === page_params.email.toLowerCase();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.is_pm_recipient = function (email, message) {
|
||||||
|
var recipients = message.reply_to.toLowerCase().split(',');
|
||||||
|
return recipients.indexOf(email.toLowerCase()) !== -1;
|
||||||
|
};
|
||||||
|
|
||||||
exports.same_major_recipient = function (a, b) {
|
exports.same_major_recipient = function (a, b) {
|
||||||
// Same behavior as same_recipient, except that it returns true for messages
|
// Same behavior as same_recipient, except that it returns true for messages
|
||||||
// on different topics but the same stream.
|
// on different topics but the same stream.
|
||||||
|
|||||||
Reference in New Issue
Block a user