mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 04:43:58 +00:00
compose_fade: Change would_receive_message to use user_id.
This commit changes the would_receive_message to use user_id instead of emails. This change is done because user_ids are immutable and using user_ids is the correct way of uniquely identifying user. The change in 'would_receive_message' also leads to change in util.is_pm_recipient to use a string of user_ids instead of emails. We also know that user_ids passed to 'would_receive_message' are active user_ids, since we get them from buddy_list. So we don't need to check whether the user is active, which was previously being checked by get_active_user_for_email.
This commit is contained in:
@@ -62,9 +62,9 @@ exports.same_stream_and_topic = function util_same_stream_and_topic(a, b) {
|
||||
lower_same(a.topic, b.topic);
|
||||
};
|
||||
|
||||
exports.is_pm_recipient = function (email, message) {
|
||||
const recipients = message.reply_to.toLowerCase().split(',');
|
||||
return recipients.includes(email.toLowerCase());
|
||||
exports.is_pm_recipient = function (user_id, message) {
|
||||
const recipients = message.to_user_ids.split(',');
|
||||
return recipients.includes(user_id.toString());
|
||||
};
|
||||
|
||||
exports.extract_pm_recipients = function (recipients) {
|
||||
|
||||
Reference in New Issue
Block a user