mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +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.
|
||||
var recipients = focused_recipient.reply_to.toLowerCase().split(',');
|
||||
return recipients.indexOf(email.toLowerCase()) !== -1;
|
||||
return util.is_pm_recipient(email, focused_recipient);
|
||||
};
|
||||
|
||||
function _fade_users() {
|
||||
|
||||
@@ -65,6 +65,11 @@ exports.is_current_user = function (email) {
|
||||
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) {
|
||||
// Same behavior as same_recipient, except that it returns true for messages
|
||||
// on different topics but the same stream.
|
||||
|
||||
Reference in New Issue
Block a user