diff --git a/static/js/message_fetch.js b/static/js/message_fetch.js index fe7265b800..b7988e3722 100644 --- a/static/js/message_fetch.js +++ b/static/js/message_fetch.js @@ -109,8 +109,8 @@ function get_messages_success(data, opts) { // or convert the emails string to user IDs directly into the Filter code // because doing so breaks the app in various modules that expect emails string. function handle_user_ids_supported_operators(data) { - var user_ids_supported_operators = ['pm-with']; - var user_id_supported_operators = ['sender', 'group-pm-with']; + var operators_supporting_ids = ['pm-with']; + var operators_supporting_id = ['sender', 'group-pm-with']; if (data.narrow === undefined) { return data; @@ -118,11 +118,11 @@ function handle_user_ids_supported_operators(data) { data.narrow = JSON.parse(data.narrow); data.narrow = _.map(data.narrow, function (filter) { - if (user_ids_supported_operators.indexOf(filter.operator) !== -1) { + if (operators_supporting_ids.indexOf(filter.operator) !== -1) { filter.operand = people.emails_strings_to_user_ids_array(filter.operand); } - if (user_id_supported_operators.indexOf(filter.operator) !== -1) { + if (operators_supporting_id.indexOf(filter.operator) !== -1) { var person = people.get_by_email(filter.operand); if (person !== undefined) { filter.operand = person.user_id; diff --git a/zerver/views/messages.py b/zerver/views/messages.py index ac434de8e6..f65d392d88 100644 --- a/zerver/views/messages.py +++ b/zerver/views/messages.py @@ -520,14 +520,14 @@ def narrow_parameter(json: str) -> OptionalNarrowListT: # Make sure to sync this list to frontend also when adding a new operator. # that supports user IDs. Relevant code is located in static/js/message_fetch.js # in handle_user_ids_supported_operators function where you will need to update - # user_id_supported_operator, or user_ids_supported_operator array. - user_id_supported_operator = ['sender', 'group-pm-with'] - user_ids_supported_operators = ['pm-with'] + # operators_supporting_id, or operators_supporting_ids array. + operators_supporting_id = ['sender', 'group-pm-with'] + operators_supporting_ids = ['pm-with'] operator = elem.get('operator', '') - if operator in user_id_supported_operator: + if operator in operators_supporting_id: operand_validator = check_string_or_int - elif operator in user_ids_supported_operators: + elif operator in operators_supporting_ids: operand_validator = check_string_or_int_list else: operand_validator = check_string