mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
Rename user_id(s)_supported_operators -> operators_supporting_id(s).
This commit is contained in:
committed by
Tim Abbott
parent
99450f336c
commit
1edde4a989
@@ -109,8 +109,8 @@ function get_messages_success(data, opts) {
|
|||||||
// or convert the emails string to user IDs directly into the Filter code
|
// 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.
|
// because doing so breaks the app in various modules that expect emails string.
|
||||||
function handle_user_ids_supported_operators(data) {
|
function handle_user_ids_supported_operators(data) {
|
||||||
var user_ids_supported_operators = ['pm-with'];
|
var operators_supporting_ids = ['pm-with'];
|
||||||
var user_id_supported_operators = ['sender', 'group-pm-with'];
|
var operators_supporting_id = ['sender', 'group-pm-with'];
|
||||||
|
|
||||||
if (data.narrow === undefined) {
|
if (data.narrow === undefined) {
|
||||||
return data;
|
return data;
|
||||||
@@ -118,11 +118,11 @@ function handle_user_ids_supported_operators(data) {
|
|||||||
|
|
||||||
data.narrow = JSON.parse(data.narrow);
|
data.narrow = JSON.parse(data.narrow);
|
||||||
data.narrow = _.map(data.narrow, function (filter) {
|
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);
|
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);
|
var person = people.get_by_email(filter.operand);
|
||||||
if (person !== undefined) {
|
if (person !== undefined) {
|
||||||
filter.operand = person.user_id;
|
filter.operand = person.user_id;
|
||||||
|
|||||||
@@ -520,14 +520,14 @@ def narrow_parameter(json: str) -> OptionalNarrowListT:
|
|||||||
# Make sure to sync this list to frontend also when adding a new operator.
|
# 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
|
# 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
|
# in handle_user_ids_supported_operators function where you will need to update
|
||||||
# user_id_supported_operator, or user_ids_supported_operator array.
|
# operators_supporting_id, or operators_supporting_ids array.
|
||||||
user_id_supported_operator = ['sender', 'group-pm-with']
|
operators_supporting_id = ['sender', 'group-pm-with']
|
||||||
user_ids_supported_operators = ['pm-with']
|
operators_supporting_ids = ['pm-with']
|
||||||
|
|
||||||
operator = elem.get('operator', '')
|
operator = elem.get('operator', '')
|
||||||
if operator in user_id_supported_operator:
|
if operator in operators_supporting_id:
|
||||||
operand_validator = check_string_or_int
|
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
|
operand_validator = check_string_or_int_list
|
||||||
else:
|
else:
|
||||||
operand_validator = check_string
|
operand_validator = check_string
|
||||||
|
|||||||
Reference in New Issue
Block a user